test_cache2-01f-basic-openTruncate.js (586B)
1 "use strict"; 2 3 function run_test() { 4 do_get_profile(); 5 6 var storage = getCacheStorage("disk"); 7 var entry = storage.openTruncate(createURI("http://new1/"), ""); 8 Assert.ok(!!entry); 9 10 // Fill the entry, and when done, check it's content 11 new OpenCallback(NEW, "meta", "data", function () { 12 asyncOpenCacheEntry( 13 "http://new1/", 14 "disk", 15 Ci.nsICacheStorage.OPEN_NORMALLY, 16 null, 17 new OpenCallback(NORMAL, "meta", "data", function () { 18 finish_cache2_test(); 19 }) 20 ); 21 }).onCacheEntryAvailable(entry, true, 0); 22 23 do_test_pending(); 24 }