aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAleksandr Likhanov <vegayours@gmail.com>2015-12-02 02:09:50 +0500
committerAleksandr Likhanov <vegayours@gmail.com>2015-12-04 20:16:43 +0500
commitd891e75d9d51a4349c5e15af0d99b4a2cb7c8ac7 (patch)
treefcf920361788d4980d5ddfdb175e0311eac9a068 /tests
parenta8cbc2864367da09fb31fb5f984a7b2d31b90b93 (diff)
downloadservo-d891e75d9d51a4349c5e15af0d99b4a2cb7c8ac7.tar.gz
servo-d891e75d9d51a4349c5e15af0d99b4a2cb7c8ac7.zip
fix intermittent Option::unwrap in timers
not allow to fire timers installed during another timer call
Diffstat (limited to 'tests')
-rw-r--r--tests/wpt/mozilla/meta/MANIFEST.json6
-rw-r--r--tests/wpt/mozilla/tests/mozilla/timer_eventInvalidation.html21
-rw-r--r--tests/wpt/mozilla/tests/mozilla/timer_eventInvalidation_test.html14
3 files changed, 41 insertions, 0 deletions
diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json
index e2b7aa33d2d..f65dfa849e2 100644
--- a/tests/wpt/mozilla/meta/MANIFEST.json
+++ b/tests/wpt/mozilla/meta/MANIFEST.json
@@ -5661,6 +5661,12 @@
"url": "/_mozilla/mozilla/textcontent.html"
}
],
+ "mozilla/timer_eventInvalidation.html": [
+ {
+ "path": "mozilla/timer_eventInvalidation.html",
+ "url": "/_mozilla/mozilla/timer_eventInvalidation.html"
+ }
+ ],
"mozilla/title.html": [
{
"path": "mozilla/title.html",
diff --git a/tests/wpt/mozilla/tests/mozilla/timer_eventInvalidation.html b/tests/wpt/mozilla/tests/mozilla/timer_eventInvalidation.html
new file mode 100644
index 00000000000..4a182a62f75
--- /dev/null
+++ b/tests/wpt/mozilla/tests/mozilla/timer_eventInvalidation.html
@@ -0,0 +1,21 @@
+<html>
+ <head>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ async_test(function(test) {
+ // couldn't reproduce this behaviour without iframe
+ var iframe = document.createElement('iframe');
+ window.addEventListener('test_done', function() {
+ // if event invalidation is not properly implemented
+ // servo will crash during a short period of time
+ setTimeout(() => test.done(), 50);
+ }, false);
+ iframe.src = 'timer_eventInvalidation_test.html';
+ document.body.appendChild(iframe);
+ });
+ </script>
+ </body>
+</html>
diff --git a/tests/wpt/mozilla/tests/mozilla/timer_eventInvalidation_test.html b/tests/wpt/mozilla/tests/mozilla/timer_eventInvalidation_test.html
new file mode 100644
index 00000000000..9656e578605
--- /dev/null
+++ b/tests/wpt/mozilla/tests/mozilla/timer_eventInvalidation_test.html
@@ -0,0 +1,14 @@
+<html>
+ <head>
+ </head>
+ <body>
+ <script>
+ setTimeout(function() {
+ setTimeout(function() {
+ var e = new Event('test_done');
+ window.parent.dispatchEvent(e);
+ }, 0);
+ }, 0);
+ </script>
+ </body>
+</html>