Bug 1371142 - Confirm that the page loaded is about:blank before continuing with the test. r=Gijs, a=test-only
authorJared Wein <jwein@mozilla.com>
Wed, 18 Jul 2018 15:40:37 -0400
changeset 478031 1e6bbba5527d056e3ce64c6d9556b9a27a8ac6a8
parent 478030 ec2f4b6b68d01f42cc0070e495b428a96eb8b01a
child 478032 78f265be217f6a73b505d788b3781bc35b4fb480
push id9502
push userryanvm@gmail.com
push dateThu, 19 Jul 2018 14:02:44 +0000
treeherdermozilla-beta@78f265be217f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, test-only
bugs1371142
milestone62.0
Bug 1371142 - Confirm that the page loaded is about:blank before continuing with the test. r=Gijs, a=test-only This matches the behavior that is implemented in subdialogs.js where the load event handler is not removed until the new location is about:blank. MozReview-Commit-ID: FZHW6Z63M2M
browser/components/preferences/in-content/tests/browser_subdialogs.js
--- a/browser/components/preferences/in-content/tests/browser_subdialogs.js
+++ b/browser/components/preferences/in-content/tests/browser_subdialogs.js
@@ -73,17 +73,19 @@ async function close_subdialog_and_test_
     info("waiting for dialogclosing");
     let closingEvent =
       await ContentTaskUtils.waitForEvent(frame.contentWindow, "dialogclosing");
     let contentClosingButton = closingEvent.detail.button;
     let actualAcceptCount = frame.contentWindow.arguments &&
                             frame.contentWindow.arguments[0].acceptCount;
 
     info("waiting for about:blank load");
-    await ContentTaskUtils.waitForEvent(frame, "load");
+    await ContentTaskUtils.waitForEvent(frame, "load", false, () => {
+      return frame.contentWindow.location.href == "about:blank";
+    });
 
     Assert.notEqual(win.getComputedStyle(subdialog._overlay).visibility, "visible",
       "overlay is not visible");
     Assert.equal(frame.getAttribute("style"), "", "inline styles should be cleared");
     Assert.equal(frame.contentWindow.location.href.toString(), "about:blank",
       "sub-dialog should be unloaded");
     Assert.equal(contentClosingButton, expectations.closingButton,
       "closing event should indicate button was '" + expectations.closingButton + "'");