|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 * http://creativecommons.org/publicdomain/zero/1.0/ |
|
3 */ |
|
4 |
|
5 function test() { |
|
6 waitForExplicitFinish(); |
|
7 |
|
8 registerCleanupFunction(function() { |
|
9 Services.prefs.clearUserPref("browser.startup.homepage"); |
|
10 Services.prefs.clearUserPref("browser.startup.page"); |
|
11 win.close(); |
|
12 }); |
|
13 |
|
14 let homepage = "about:home"; |
|
15 Services.prefs.setCharPref("browser.startup.homepage", homepage); |
|
16 Services.prefs.setIntPref("browser.startup.page", 1); |
|
17 let win = OpenBrowserWindow(); |
|
18 whenDelayedStartupFinished(win, function() { |
|
19 let browser = win.gBrowser.selectedBrowser; |
|
20 if (browser.contentDocument.readyState == "complete" && |
|
21 browser.currentURI.spec == homepage) { |
|
22 checkIdentityMode(win); |
|
23 return; |
|
24 } |
|
25 |
|
26 browser.addEventListener("load", function onLoad() { |
|
27 if (browser.currentURI.spec != homepage) |
|
28 return; |
|
29 browser.removeEventListener("load", onLoad, true); |
|
30 checkIdentityMode(win); |
|
31 }, true); |
|
32 }); |
|
33 } |
|
34 |
|
35 function checkIdentityMode(win) { |
|
36 let identityMode = win.document.getElementById("identity-box").className; |
|
37 is(identityMode, "chromeUI", "Identity state should be chromeUI for about:home in a new window"); |
|
38 finish(); |
|
39 } |