toolkit/mozapps/extensions/test/xpinstall/browser_enabled2.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 // ----------------------------------------------------------------------------
     2 // Test whether an InstallTrigger.enabled is working
     3 function test() {
     4   waitForExplicitFinish();
     6   Services.prefs.setBoolPref("xpinstall.enabled", false);
     8   gBrowser.selectedTab = gBrowser.addTab();
     9   gBrowser.selectedBrowser.addEventListener("load", function() {
    10     gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
    11     // Allow the in-page load handler to run first
    12     executeSoon(page_loaded);
    13   }, true);
    14   gBrowser.loadURI(TESTROOT + "enabled.html");
    15 }
    17 function page_loaded() {
    18   Services.prefs.clearUserPref("xpinstall.enabled");
    20   var doc = gBrowser.contentDocument;
    21   is(doc.getElementById("enabled").textContent, "false", "installTrigger should have not been enabled");
    22   gBrowser.removeCurrentTab();
    23   finish();
    24 }

mercurial