|
1 Components.utils.import('resource://gre/modules/LoadContextInfo.jsm'); |
|
2 |
|
3 function run_test() |
|
4 { |
|
5 do_get_profile(); |
|
6 |
|
7 if (!newCacheBackEndUsed()) { |
|
8 do_check_true(true, "This test doesn't run when the old cache back end is used since the behavior is different"); |
|
9 return; |
|
10 } |
|
11 |
|
12 // Create and check an entry anon disk storage |
|
13 asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous, |
|
14 new OpenCallback(NEW, "an1", "an1", function(entry) { |
|
15 asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous, |
|
16 new OpenCallback(NORMAL, "an1", "an1", function(entry) { |
|
17 // Create and check an entry non-anon disk storage |
|
18 asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default, |
|
19 new OpenCallback(NEW, "na1", "na1", function(entry) { |
|
20 asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default, |
|
21 new OpenCallback(NORMAL, "na1", "na1", function(entry) { |
|
22 // check the anon entry is still there and intact |
|
23 asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous, |
|
24 new OpenCallback(NORMAL, "an1", "an1", function(entry) { |
|
25 finish_cache2_test(); |
|
26 }) |
|
27 ); |
|
28 }) |
|
29 ); |
|
30 }) |
|
31 ); |
|
32 }) |
|
33 ); |
|
34 }) |
|
35 ); |
|
36 |
|
37 do_test_pending(); |
|
38 } |