toolkit/mozapps/extensions/test/xpinstall/browser_empty.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 install fails when there is no install script present.
     3 function test() {
     4   Harness.downloadFailedCallback = download_failed;
     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   var triggers = encodeURIComponent(JSON.stringify({
    12     "Empty XPI": TESTROOT + "empty.xpi"
    13   }));
    14   gBrowser.selectedTab = gBrowser.addTab();
    15   gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
    16 }
    18 function download_failed(install) {
    19   is(install.error, AddonManager.ERROR_CORRUPT_FILE, "Install should fail");
    20 }
    22 function finish_test(count) {
    23   is(count, 0, "No add-ons should have been installed");
    24   Services.perms.remove("example.com", "install");
    26   gBrowser.removeCurrentTab();
    27   Harness.finish();
    28 }

mercurial