Bug 1845311 - [Part 2] Use ChromeUtils.defineLazyGetter in more places r=arai,webcomp...
[gecko.git] / netwerk / test / unit / test_cache2-04-oncacheentryavail-throws2x.js
blobdce2b483ffb56166d7070c4dc8f98b4e4e825b40
1 "use strict";
3 function run_test() {
4   do_get_profile();
6   // Open but let OCEA throw
7   asyncOpenCacheEntry(
8     "http://d/",
9     "disk",
10     Ci.nsICacheStorage.OPEN_NORMALLY,
11     null,
12     new OpenCallback(NEW | THROWAVAIL, null, null, function (entry) {
13       // Open but let OCEA throw ones again
14       asyncOpenCacheEntry(
15         "http://d/",
16         "disk",
17         Ci.nsICacheStorage.OPEN_NORMALLY,
18         null,
19         new OpenCallback(NEW | THROWAVAIL, null, null, function (entry) {
20           // Try it again, should go
21           asyncOpenCacheEntry(
22             "http://d/",
23             "disk",
24             Ci.nsICacheStorage.OPEN_NORMALLY,
25             null,
26             new OpenCallback(NEW, "d1m", "d1d", function (entry) {
27               // ...and check
28               asyncOpenCacheEntry(
29                 "http://d/",
30                 "disk",
31                 Ci.nsICacheStorage.OPEN_NORMALLY,
32                 null,
33                 new OpenCallback(NORMAL, "d1m", "d1d", function (entry) {
34                   finish_cache2_test();
35                 })
36               );
37             })
38           );
39         })
40       );
41     })
42   );
44   do_test_pending();