gecko-dev/browser/base/content/test/general/browser_bug882977.js
Mike Conley 50c92f7548 Bug 1276966 - Fix tests that were accidentally resetting browser.startup.page. r=mikedeboer
MozReview-Commit-ID: 3E4xVfdGDIi

--HG--
extra : rebase_source : ecb6d86c9d045160ad6b0484a0c28bb75bb13440
2016-05-29 12:01:18 -04:00

36 lines
1.1 KiB
JavaScript

"use strict";
/**
* Tests that the identity-box shows the chromeUI styling
* when viewing about:home in a new window.
*/
add_task(function*(){
let homepage = "about:home";
yield SpecialPowers.pushPrefEnv({
"set": [
["browser.startup.homepage", homepage],
["browser.startup.page", 1],
]
});
let win = OpenBrowserWindow();
yield BrowserTestUtils.waitForEvent(win, "load");
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);
}
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");
}