Bug 1371142 - Confirm that the page loaded is about:blank before continuing with the test. r?gijs
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
--- 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 + "'");