netwerk/test/unit/test_cache2-18-not-valid.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 run_test()
     2 {
     3   do_get_profile();
     5   if (!newCacheBackEndUsed()) {
     6     do_check_true(true, "This test doesn't run when the old cache back end is used since the behavior is different");
     7     return;
     8   }
    10   // Open for write, write but expect it to fail, since other callback will recreate (and doom)
    11   // the first entry before it opens output stream (note: in case of problems the DOOMED flag
    12   // can be removed, it is not the test failure when opening the output stream on recreated entry.
    13   asyncOpenCacheEntry("http://nv/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
    14     new OpenCallback(NEW|DOOMED, "v1m", "v1d", function(entry) {
    15       // Open for rewrite (don't validate), write different meta and data
    16       asyncOpenCacheEntry("http://nv/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
    17         new OpenCallback(NOTVALID|RECREATE, "v2m", "v2d", function(entry) {
    18           // And check...
    19           asyncOpenCacheEntry("http://nv/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
    20             new OpenCallback(NORMAL, "v2m", "v2d", function(entry) {
    21               finish_cache2_test();
    22             })
    23           );
    24         })
    25       );
    26     })
    27   );
    29   do_test_pending();
    30 }

mercurial