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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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