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