Bug 1312960 - Fix test_child_docshell.html (r=ochameau)
☠☠ backed out by be5f087a2c4e ☠ ☠
authorBill McCloskey <billm@mozilla.com>
Thu, 27 Oct 2016 14:38:24 -0700
changeset 320119 bfee38f564edbae9c4d0a70ce5e9276d4d50d944
parent 320118 73e04e795ec392a4046ad9ee25906ee2f482c26d
child 320120 b119fb8bc703861588bfefcd70f6c42ef9d391f2
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1312960
milestone52.0a1
Bug 1312960 - Fix test_child_docshell.html (r=ochameau)
dom/ipc/tests/test_child_docshell.html
--- a/dom/ipc/tests/test_child_docshell.html
+++ b/dom/ipc/tests/test_child_docshell.html
@@ -69,17 +69,25 @@ SpecialPowers.pushPrefEnv({'set':[
                                 .QueryInterface(Ci.nsIDocShell);
       sendAsyncMessage("DOMWindowCreatedReceived", {
         stableChromeEventHandler: chromeEventHandler === docShell.chromeEventHandler,
         iframeHasNewDocShell: new_docShell !== docShell,
         iframeHasSameChromeEventHandler: new_docShell.chromeEventHandler === chromeEventHandler
       });
     });
 
-    let i = content.document.createElement("iframe");
-    i.setAttribute("src", "data:text/html,foo");
-    content.document.documentElement.appendChild(i);
+    function go() {
+      let i = content.document.createElement("iframe");
+      i.setAttribute("src", "data:text/html,foo");
+      content.document.documentElement.appendChild(i);
+    }
+
+    if (content.document.readyState == "complete") {
+      go();
+    } else {
+      addEventListener("load", go, true);
+    }
   }, false);
 });
 
 </script>
 </body>
 </html>