browser/base/content/test/general/browser_bug882977.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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 }

mercurial