Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 function run_test()
2 {
3 do_get_profile();
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 }
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 );
29 do_test_pending();
30 }