tor-browser

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

test_cache2-14-concurent-readers.js (980B)


      1 "use strict";
      2 
      3 function run_test() {
      4  do_get_profile();
      5 
      6  asyncOpenCacheEntry(
      7    "http://x/",
      8    "disk",
      9    Ci.nsICacheStorage.OPEN_NORMALLY,
     10    null,
     11    new OpenCallback(NEW, "x1m", "x1d", function () {
     12      // nothing to do here, we expect concurent callbacks to get
     13      // all notified, then the test finishes
     14    })
     15  );
     16 
     17  var mc = new MultipleCallbacks(3, finish_cache2_test);
     18 
     19  asyncOpenCacheEntry(
     20    "http://x/",
     21    "disk",
     22    Ci.nsICacheStorage.OPEN_NORMALLY,
     23    null,
     24    new OpenCallback(NORMAL, "x1m", "x1d", function () {
     25      mc.fired();
     26    })
     27  );
     28  asyncOpenCacheEntry(
     29    "http://x/",
     30    "disk",
     31    Ci.nsICacheStorage.OPEN_NORMALLY,
     32    null,
     33    new OpenCallback(NORMAL, "x1m", "x1d", function () {
     34      mc.fired();
     35    })
     36  );
     37  asyncOpenCacheEntry(
     38    "http://x/",
     39    "disk",
     40    Ci.nsICacheStorage.OPEN_NORMALLY,
     41    null,
     42    new OpenCallback(NORMAL, "x1m", "x1d", function () {
     43      mc.fired();
     44    })
     45  );
     46 
     47  do_test_pending();
     48 }