toolkit/mozapps/extensions/test/xpinstall/browser_localfile.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 installing an local file works when loading the url
     3 function test() {
     4   Harness.installEndedCallback = install_ended;
     5   Harness.installsCompletedCallback = finish_test;
     6   Harness.setup();
     8   var cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
     9                      .getService(Components.interfaces.nsIChromeRegistry);
    11   var chromeroot = extractChromeRoot(gTestPath);
    12   try {
    13     var xpipath = cr.convertChromeURL(makeURI(chromeroot + "unsigned.xpi")).spec;
    14   } catch (ex) {
    15     var xpipath = chromeroot + "unsigned.xpi"; //scenario where we are running from a .jar and already extracted
    16   }
    17   gBrowser.selectedTab = gBrowser.addTab();
    18   gBrowser.loadURI(xpipath);
    19 }
    21 function install_ended(install, addon) {
    22   install.cancel();
    23 }
    25 function finish_test(count) {
    26   is(count, 1, "1 Add-on should have been successfully installed");
    28   gBrowser.removeCurrentTab();
    29   Harness.finish();
    30 }
    31 // ----------------------------------------------------------------------------

mercurial