Bug 1346286 - Remove CPOWs from browser_aboutCertError.js. r=Gijs
MozReview-Commit-ID: A7y6UfyHut0
--- a/browser/base/content/test/general/browser_aboutCertError.js
+++ b/browser/base/content/test/general/browser_aboutCertError.js
@@ -30,24 +30,24 @@ add_task(function* checkReturnToAboutHom
// Populate the shistory entries manually, since it happens asynchronously
// and the following tests will be too soon otherwise.
yield TabStateFlusher.flush(browser);
let {entries} = JSON.parse(ss.getTabState(tab));
is(entries.length, 1, "there is one shistory entry");
info("Clicking the go back button on about:certerror");
- let pageshowPromise = promiseWaitForEvent(browser, "pageshow");
yield ContentTask.spawn(browser, null, function* () {
let doc = content.document;
let returnButton = doc.getElementById("returnButton");
is(returnButton.getAttribute("autofocus"), "true", "returnButton has autofocus");
returnButton.click();
+
+ yield ContentTaskUtils.waitForEvent(this, "pageshow", true);
});
- yield pageshowPromise;
is(browser.webNavigation.canGoBack, true, "webNavigation.canGoBack");
is(browser.webNavigation.canGoForward, false, "!webNavigation.canGoForward");
is(gBrowser.currentURI.spec, "about:home", "Went back");
yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
});
@@ -66,23 +66,23 @@ add_task(function* checkReturnToPrevious
// Populate the shistory entries manually, since it happens asynchronously
// and the following tests will be too soon otherwise.
yield TabStateFlusher.flush(browser);
let {entries} = JSON.parse(ss.getTabState(tab));
is(entries.length, 2, "there are two shistory entries");
info("Clicking the go back button on about:certerror");
- let pageshowPromise = promiseWaitForEvent(browser, "pageshow");
yield ContentTask.spawn(browser, null, function* () {
let doc = content.document;
let returnButton = doc.getElementById("returnButton");
returnButton.click();
+
+ yield ContentTaskUtils.waitForEvent(this, "pageshow", true);
});
- yield pageshowPromise;
is(browser.webNavigation.canGoBack, false, "!webNavigation.canGoBack");
is(browser.webNavigation.canGoForward, true, "webNavigation.canGoForward");
is(gBrowser.currentURI.spec, GOOD_PAGE, "Went back");
yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
});