test_cache2-18-not-valid.js (1132B)
1 "use strict"; 2 3 function run_test() { 4 do_get_profile(); 5 6 // Open for write, write but expect it to fail, since other callback will recreate (and doom) 7 // the first entry before it opens output stream (note: in case of problems the DOOMED flag 8 // can be removed, it is not the test failure when opening the output stream on recreated entry. 9 asyncOpenCacheEntry( 10 "http://nv/", 11 "disk", 12 Ci.nsICacheStorage.OPEN_NORMALLY, 13 null, 14 new OpenCallback(NEW | DOOMED, "v1m", "v1d", function () { 15 // Open for rewrite (don't validate), write different meta and data 16 asyncOpenCacheEntry( 17 "http://nv/", 18 "disk", 19 Ci.nsICacheStorage.OPEN_NORMALLY, 20 null, 21 new OpenCallback(NOTVALID | RECREATE, "v2m", "v2d", function () { 22 // And check... 23 asyncOpenCacheEntry( 24 "http://nv/", 25 "disk", 26 Ci.nsICacheStorage.OPEN_NORMALLY, 27 null, 28 new OpenCallback(NORMAL, "v2m", "v2d", function () { 29 finish_cache2_test(); 30 }) 31 ); 32 }) 33 ); 34 }) 35 ); 36 37 do_test_pending(); 38 }