toolkit/mozapps/extensions/test/xpinstall/browser_softwareupdate.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 // Tests that calling InstallTrigger.startSoftwareUpdate works
     3 function test() {
     4   Harness.installEndedCallback = install_ended;
     5   Harness.installsCompletedCallback = finish_test;
     6   Harness.setup();
     8   var pm = Services.perms;
     9   pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
    11   gBrowser.selectedTab = gBrowser.addTab();
    12   gBrowser.loadURI(TESTROOT + "startsoftwareupdate.html? " + encodeURIComponent(TESTROOT + "unsigned.xpi"));
    13 }
    15 function install_ended(install, addon) {
    16   install.cancel();
    17 }
    19 function finish_test(count) {
    20   is(count, 1, "1 Add-on should have been successfully installed");
    21   Services.perms.remove("example.com", "install");
    23   gBrowser.removeCurrentTab();
    24   Harness.finish();
    25 }

mercurial