netwerk/test/unit/test_freshconnection.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 // This is essentially a debug mode crashtest to make sure everything
     2 // involved in a reload runs on the right thread. It relies on the
     3 // assertions in necko.
     5 var listener = {
     6   onStartRequest: function test_onStartR(request, ctx) {
     7   },
     9   onDataAvailable: function test_ODA() {
    10     do_throw("Should not get any data!");
    11   },
    13   onStopRequest: function test_onStopR(request, ctx, status) {
    14     do_test_finished();
    15   },
    16 };
    18 function run_test() {
    19   var ios = Cc["@mozilla.org/network/io-service;1"].
    20                        getService(Ci.nsIIOService);
    21   var chan = ios.newChannel("http://localhost:4444", "", null);
    22   chan.loadFlags = Ci.nsIRequest.LOAD_FRESH_CONNECTION |
    23 	           Ci.nsIChannel.LOAD_INITIAL_DOCUMENT_URI;
    24   chan.QueryInterface(Ci.nsIHttpChannel);
    25   chan.asyncOpen(listener, null);
    26   do_test_pending();
    27 }

mercurial