Bug 1346286 - Remove CPOWs from browser_aboutCertError.js. r=Gijs draft
authorBlake Kaplan <mrbkap@gmail.com>
Thu, 09 Mar 2017 14:38:02 -0800
changeset 499552 a65b68cce684c96065a72dbf7563914666c93679
parent 499551 705fbd00ac358ed170d4bd00f695adc05a340765
child 499553 55a864ea1b588731aabf851c8459c71ff42d8b61
push id49450
push userbmo:mrbkap@mozilla.com
push dateWed, 15 Mar 2017 23:51:54 +0000
reviewersGijs
bugs1346286
milestone55.0a1
Bug 1346286 - Remove CPOWs from browser_aboutCertError.js. r=Gijs MozReview-Commit-ID: A7y6UfyHut0
browser/base/content/test/general/browser_aboutCertError.js
--- 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);
 });