|
1 function run_test() |
|
2 { |
|
3 do_get_profile(); |
|
4 |
|
5 if (!newCacheBackEndUsed()) { |
|
6 do_check_true(true, "This test doesn't run when the old cache back end is used since the behavior is different"); |
|
7 return; |
|
8 } |
|
9 |
|
10 // Open for write, write but expect it to fail, since other callback will recreate (and doom) |
|
11 // the first entry before it opens output stream (note: in case of problems the DOOMED flag |
|
12 // can be removed, it is not the test failure when opening the output stream on recreated entry. |
|
13 asyncOpenCacheEntry("http://nv/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null, |
|
14 new OpenCallback(NEW|DOOMED, "v1m", "v1d", function(entry) { |
|
15 // Open for rewrite (don't validate), write different meta and data |
|
16 asyncOpenCacheEntry("http://nv/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null, |
|
17 new OpenCallback(NOTVALID|RECREATE, "v2m", "v2d", function(entry) { |
|
18 // And check... |
|
19 asyncOpenCacheEntry("http://nv/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null, |
|
20 new OpenCallback(NORMAL, "v2m", "v2d", function(entry) { |
|
21 finish_cache2_test(); |
|
22 }) |
|
23 ); |
|
24 }) |
|
25 ); |
|
26 }) |
|
27 ); |
|
28 |
|
29 do_test_pending(); |
|
30 } |