Bug 1318720 - Add test for calling rIC on removed iframe. r=smaug
authorAndreas Farre <farre@mozilla.com>
Thu, 16 Mar 2017 18:18:34 +0100
changeset 348681 c3caab4cb674f15d9138fe4817ab940ffc843f56
parent 348680 58d628a5c367c6c6f1b092988b6b3ee4054bf1f5
child 348682 035e1b8fe643c0839bff00a6845590fa7c12eb31
push id31533
push userkwierso@gmail.com
push dateTue, 21 Mar 2017 23:08:53 +0000
treeherdermozilla-central@8744e9f8eb99 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1318720
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1318720 - Add test for calling rIC on removed iframe. r=smaug MozReview-Commit-ID: 9TGGSxcUHs2
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/html/webappapis/idle-callbacks/callback-removed-frame.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -97335,16 +97335,22 @@
     ]
    ],
    "html/webappapis/idle-callbacks/callback-multiple-calls.html": [
     [
      "/html/webappapis/idle-callbacks/callback-multiple-calls.html",
      {}
     ]
    ],
+   "html/webappapis/idle-callbacks/callback-removed-frame.html": [
+    [
+     "/html/webappapis/idle-callbacks/callback-removed-frame.html",
+     {}
+    ]
+   ],
    "html/webappapis/idle-callbacks/callback-suspended.html": [
     [
      "/html/webappapis/idle-callbacks/callback-suspended.html",
      {}
     ]
    ],
    "html/webappapis/idle-callbacks/callback-timeout-with-raf.html": [
     [
@@ -181295,31 +181301,35 @@
    "1349f9f3bc645fc999dcd2da6e53aa46779053c6",
    "testharness"
   ],
   "html/webappapis/idle-callbacks/callback-exception.html": [
    "84270b568b8f4d67d04da5df99cd2e0eb8e51977",
    "testharness"
   ],
   "html/webappapis/idle-callbacks/callback-idle-periods.html": [
-   "29559d93a0401a3bc62b2cb717c438a01c1f439a",
+   "65056dde042c8c0a25d3f9c375f0925aabab955f",
    "testharness"
   ],
   "html/webappapis/idle-callbacks/callback-iframe.html": [
    "ace7008a593a32ca016685aaa85bda9b4c4bd8c8",
    "testharness"
   ],
   "html/webappapis/idle-callbacks/callback-invoked.html": [
    "e7cf5a399d92f1fcb98f6ebb1ed3283d60d2bfe2",
    "testharness"
   ],
   "html/webappapis/idle-callbacks/callback-multiple-calls.html": [
    "6375309c43a1e7c9fafdc95f01fcccb4c92f8afc",
    "testharness"
   ],
+  "html/webappapis/idle-callbacks/callback-removed-frame.html": [
+   "79b4a278f0e35646cfdffeebf8f0523e2772bc9b",
+   "testharness"
+  ],
   "html/webappapis/idle-callbacks/callback-suspended.html": [
    "f3f9eeda9e2d47825c77eaf278be6e976a8e1715",
    "testharness"
   ],
   "html/webappapis/idle-callbacks/callback-timeout-with-raf.html": [
    "febb81c38f530c81d9e9837df2c6d603225ecfd1",
    "testharness"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-removed-frame.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>requestIdleCallback on removed frame shouldn't call back</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+  async_test(function (t) {
+    assert_false(document.hidden, "document.hidden must exist and be false to run this test properly");
+
+    function start() {
+      var frame = document.createElement('iframe');
+      frame.addEventListener('load', _ => connect(frame), {once:true});
+      frame.src = "about:blank";
+      document.body.appendChild(frame);
+    }
+
+    function connect(frame) {
+      var contentWindow = frame.contentWindow;
+      contentWindow.requestIdleCallback(_ => callback0(frame, contentWindow));
+      t.step_timeout(function() { t.done(); }, 1000);
+    }
+
+    function callback0(f, w) {
+      document.body.removeChild(f);
+      w.requestIdleCallback(t.unreached_func("requestIdleCallback callback should not trigger the callback"));
+    }
+
+    addEventListener('load', start, {once:true});
+  }, "calling requestIdleCallback on a contentWindow from a removed iframe should not trigger the callback");
+</script>