xpcom/tests/unit/test_comp_no_aslr.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 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
     3 const Cc = Components.classes;
     4 const Ci = Components.interfaces;
     6 function run_test() {
     7   let manifest = do_get_file('testcompnoaslr.manifest');
     8   Components.manager.autoRegister(manifest);
     9   var sysInfo = Cc["@mozilla.org/system-info;1"].
    10                 getService(Ci.nsIPropertyBag2);
    11   var ver = parseFloat(sysInfo.getProperty("version"));
    12   if (ver < 6.0) {
    13     // This is disabled on pre-Vista OSs.
    14     do_check_true("{335fb596-e52d-418f-b01c-1bf16ce5e7e4}" in Components.classesByID);
    15   } else {
    16     do_check_false("{335fb596-e52d-418f-b01c-1bf16ce5e7e4}" in Components.classesByID);
    17   }
    18 }

mercurial