netwerk/test/unit/test_bug336501.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 var Cc = Components.classes;
     2 var Ci = Components.interfaces;
     4 function run_test() {
     5   var f = do_get_file('test_bug336501.js');
     7   var fis =
     8       Cc["@mozilla.org/network/file-input-stream;1"].
     9       createInstance(Ci.nsIFileInputStream);
    10   fis.init(f, -1, -1, 0); 
    12   var bis =
    13       Cc["@mozilla.org/network/buffered-input-stream;1"].
    14       createInstance(Ci.nsIBufferedInputStream);
    15   bis.init(fis, 32);
    17   var sis =
    18       Cc["@mozilla.org/scriptableinputstream;1"].
    19       createInstance(Ci.nsIScriptableInputStream);
    20   sis.init(bis);
    22   sis.read(45);
    23   sis.close();
    25   var data = sis.read(45);
    26   do_check_eq(data.length, 0);
    27 }

mercurial