tor-browser

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

test_cache2-21-anon-storage.js (1629B)


      1 "use strict";
      2 
      3 function run_test() {
      4  do_get_profile();
      5 
      6  // Create and check an entry anon disk storage
      7  asyncOpenCacheEntry(
      8    "http://anon1/",
      9    "disk",
     10    Ci.nsICacheStorage.OPEN_NORMALLY,
     11    Services.loadContextInfo.anonymous,
     12    new OpenCallback(NEW, "an1", "an1", function () {
     13      asyncOpenCacheEntry(
     14        "http://anon1/",
     15        "disk",
     16        Ci.nsICacheStorage.OPEN_NORMALLY,
     17        Services.loadContextInfo.anonymous,
     18        new OpenCallback(NORMAL, "an1", "an1", function () {
     19          // Create and check an entry non-anon disk storage
     20          asyncOpenCacheEntry(
     21            "http://anon1/",
     22            "disk",
     23            Ci.nsICacheStorage.OPEN_NORMALLY,
     24            Services.loadContextInfo.default,
     25            new OpenCallback(NEW, "na1", "na1", function () {
     26              asyncOpenCacheEntry(
     27                "http://anon1/",
     28                "disk",
     29                Ci.nsICacheStorage.OPEN_NORMALLY,
     30                Services.loadContextInfo.default,
     31                new OpenCallback(NORMAL, "na1", "na1", function () {
     32                  // check the anon entry is still there and intact
     33                  asyncOpenCacheEntry(
     34                    "http://anon1/",
     35                    "disk",
     36                    Ci.nsICacheStorage.OPEN_NORMALLY,
     37                    Services.loadContextInfo.anonymous,
     38                    new OpenCallback(NORMAL, "an1", "an1", function () {
     39                      finish_cache2_test();
     40                    })
     41                  );
     42                })
     43              );
     44            })
     45          );
     46        })
     47      );
     48    })
     49  );
     50 
     51  do_test_pending();
     52 }