tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_cache2-22-anon-visit.js (1056B)


      1 "use strict";
      2 
      3 function run_test() {
      4  do_get_profile();
      5 
      6  var mc = new MultipleCallbacks(2, function () {
      7    var storage = getCacheStorage("disk", Services.loadContextInfo.default);
      8    storage.asyncVisitStorage(
      9      new VisitCallback(1, 1024, ["http://an2/"], function () {
     10        storage = getCacheStorage("disk", Services.loadContextInfo.anonymous);
     11        storage.asyncVisitStorage(
     12          new VisitCallback(1, 1024, ["http://an2/"], function () {
     13            finish_cache2_test();
     14          }),
     15          true
     16        );
     17      }),
     18      true
     19    );
     20  });
     21 
     22  asyncOpenCacheEntry(
     23    "http://an2/",
     24    "disk",
     25    Ci.nsICacheStorage.OPEN_NORMALLY,
     26    Services.loadContextInfo.default,
     27    new OpenCallback(NEW | WAITFORWRITE, "an2", "an2", function () {
     28      mc.fired();
     29    })
     30  );
     31 
     32  asyncOpenCacheEntry(
     33    "http://an2/",
     34    "disk",
     35    Ci.nsICacheStorage.OPEN_NORMALLY,
     36    Services.loadContextInfo.anonymous,
     37    new OpenCallback(NEW | WAITFORWRITE, "an2", "an2", function () {
     38      mc.fired();
     39    })
     40  );
     41 
     42  do_test_pending();
     43 }