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.

     1 /* Any copyright is dedicated to the Public Domain.
     2  * http://creativecommons.org/publicdomain/zero/1.0/
     3  */
     5 function test() {
     6   waitForExplicitFinish();
     8   registerCleanupFunction(function() {
     9     Services.prefs.clearUserPref("browser.startup.homepage");
    10     Services.prefs.clearUserPref("browser.startup.page");
    11     win.close();
    12   });
    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     }
    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 }
    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 }

mercurial