js/xpconnect/tests/unit/test_bug845201.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 function sbTest() {
     2   var threw = false;
     3   try {
     4     for (var x in Components) { }
     5     do_check_true(false, "Shouldn't be able to enumerate Components");
     6   } catch(e) {
     7     do_check_true(true, "Threw appropriately");
     8     threw = true;
     9   }
    10   do_check_true(threw, "Shouldn't have thrown uncatchable exception");
    11 }
    13 function run_test() {
    14   var sb = Components.utils.Sandbox('http://www.example.com', { wantComponents: true });
    15   sb.do_check_true = do_check_true;
    16   Components.utils.evalInSandbox(sbTest.toSource(), sb);
    17   Components.utils.evalInSandbox('sbTest();', sb);
    18 }

mercurial