Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / netwerk / test / unit / test_cache2-30b-pinning-storage-clear.js
blob21f7f02e45256a89b585ec298494daa9496a0ef5
1 "use strict";
3 function run_test() {
4 do_get_profile();
6 var lci = Services.loadContextInfo.default;
8 // Open a pinned entry for write, write
9 asyncOpenCacheEntry(
10 "http://a/",
11 "pin",
12 Ci.nsICacheStorage.OPEN_TRUNCATE,
13 lci,
14 new OpenCallback(NEW | WAITFORWRITE, "a1m", "a1d", function () {
15 // Now clear the disk storage, that should leave the pinned entry in the cache
16 var diskStorage = getCacheStorage("disk", lci);
17 diskStorage.asyncEvictStorage(null);
19 // Open for read and check, it should still be there
20 asyncOpenCacheEntry(
21 "http://a/",
22 "disk",
23 Ci.nsICacheStorage.OPEN_NORMALLY,
24 lci,
25 new OpenCallback(NORMAL, "a1m", "a1d", function () {
26 // Now clear the pinning storage, entry should be gone
27 var pinningStorage = getCacheStorage("pin", lci);
28 pinningStorage.asyncEvictStorage(null);
30 asyncOpenCacheEntry(
31 "http://a/",
32 "disk",
33 Ci.nsICacheStorage.OPEN_NORMALLY,
34 lci,
35 new OpenCallback(NEW, "", "", function () {
36 finish_cache2_test();
44 do_test_pending();