Bug 1391756 - Try to fix rare timeout in dom/tests/mochitest/fetch/test_readableStreams.html. r=baku
authorJason Orendorff <jorendorff@mozilla.com>
Thu, 29 Nov 2018 22:35:04 +0000
changeset 508083 7180b12513ad5f0a0d1edf3188610a848b3b6ebf
parent 508082 5808b57453825fe1185e94fd4e7e2e551bdf878f
child 508084 7a24e1e35a7e4a372f719463ca367882bb6de5dd
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1391756
milestone65.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 1391756 - Try to fix rare timeout in dom/tests/mochitest/fetch/test_readableStreams.html. r=baku Also removes an infinite regress of nested iframes. The original problem was that tests would start running before the child iframe was done loading. The straightforward fix is to have the child frame start the test. But this caused further error messages because the child iframe is loaded more than once; removing the iframe from the iframe fixes this. Differential Revision: https://phabricator.services.mozilla.com/D13385
dom/tests/mochitest/fetch/common_readableStreams.js
dom/tests/mochitest/fetch/iframe_readableStreams.html
dom/tests/mochitest/fetch/test_readableStreams.html
--- a/dom/tests/mochitest/fetch/common_readableStreams.js
+++ b/dom/tests/mochitest/fetch/common_readableStreams.js
@@ -18,17 +18,17 @@ function makeBuffer(size) {
 function apply_compartment(compartment, data) {
   if (compartment == SAME_COMPARTMENT) {
     self[data.func](data.args, self);
     return;
   }
 
   if (compartment == IFRAME_COMPARTMENT) {
     const iframe = document.querySelector("#iframe").contentWindow;
-    iframe.runTest.call(iframe, data);
+    iframe[data.func](data.args, self);
     return;
   }
 
   ok(false, "Invalid compartment value");
 }
 
 async function test_nativeStream(compartment) {
   info("test_nativeStream");
--- a/dom/tests/mochitest/fetch/iframe_readableStreams.html
+++ b/dom/tests/mochitest/fetch/iframe_readableStreams.html
@@ -1,8 +1,4 @@
-<iframe src="iframe_readableStreams.html" id="iframe"></iframe>
 <script type="application/javascript" src="common_readableStreams.js"></script>
 <script>
-function runTest(data) {
-  const iframe = document.querySelector("#iframe").contentWindow;
-  self[data.func].call(iframe, data.args, parent);
-}
+parent.next();
 </script>
--- a/dom/tests/mochitest/fetch/test_readableStreams.html
+++ b/dom/tests/mochitest/fetch/test_readableStreams.html
@@ -3,17 +3,16 @@
 <head>
   <meta charset="utf-8">
   <title>Test for ReadableStreams and Fetch</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="common_readableStreams.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
-  <iframe src="iframe_readableStreams.html" id="iframe"></iframe>
   <script type="application/javascript">
 
 let tests = [
   function() {
     SpecialPowers.pushPrefEnv({
       "set": [["dom.caches.enabled", true],
               ["dom.caches.testing.enabled", true],
               ["dom.quotaManager.testing", true]]
@@ -62,14 +61,14 @@ function next() {
     return;
   }
 
   let test = tests.shift();
   test();
 }
 
 SimpleTest.waitForExplicitFinish();
-next();
-
+// The iframe starts the tests by calling parent.next() when it loads.
   </script>
+  <iframe src="iframe_readableStreams.html" id="iframe"></iframe>
 </body>
 </html>