Bug 1346286 - Remove CPOWs from browser_bug882977.js. r=Felipe draft
authorBlake Kaplan <mrbkap@gmail.com>
Thu, 09 Mar 2017 11:23:27 -0800
changeset 499549 2f3311619efef35ad97c6ffbe6e1fd0857afa722
parent 499548 3ee9ee96a2e87a96e411a720737fbade0581de3f
child 499550 8b70f9886950e0caaefee35e2e3927315887e85f
push id49450
push userbmo:mrbkap@mozilla.com
push dateWed, 15 Mar 2017 23:51:54 +0000
reviewersFelipe
bugs1346286, 882977
milestone55.0a1
Bug 1346286 - Remove CPOWs from browser_bug882977.js. r=Felipe MozReview-Commit-ID: L55dGxD3tZ1
browser/base/content/test/general/browser_bug882977.js
--- a/browser/base/content/test/general/browser_bug882977.js
+++ b/browser/base/content/test/general/browser_bug882977.js
@@ -9,28 +9,21 @@ add_task(function*() {
   yield SpecialPowers.pushPrefEnv({
     "set": [
       ["browser.startup.homepage", homepage],
       ["browser.startup.page", 1],
     ]
   });
 
   let win = OpenBrowserWindow();
-  yield BrowserTestUtils.waitForEvent(win, "load");
+  yield BrowserTestUtils.firstBrowserLoaded(win, false);
 
   let browser = win.gBrowser.selectedBrowser;
-  // If we've finished loading about:home already, we can check
-  // right away - otherwise, we need to wait.
-  if (browser.contentDocument.readyState == "complete" &&
-      browser.currentURI.spec == homepage) {
-    checkIdentityMode(win);
-  } else {
-    yield BrowserTestUtils.browserLoaded(browser, false, homepage);
-    checkIdentityMode(win);
-  }
+  is(browser.currentURI.spec, homepage, "Loaded the correct homepage");
+  checkIdentityMode(win);
 
   yield BrowserTestUtils.closeWindow(win);
 });
 
 function checkIdentityMode(win) {
   let identityMode = win.document.getElementById("identity-box").className;
   is(identityMode, "chromeUI", "Identity state should be chromeUI for about:home in a new window");
 }