michael@0: function run_test() michael@0: { michael@0: do_get_profile(); michael@0: michael@0: if (!newCacheBackEndUsed()) { michael@0: do_check_true(true, "This test doesn't run when the old cache back end is used since the behavior is different"); michael@0: return; michael@0: } michael@0: michael@0: var mc = new MultipleCallbacks(3, function() { michael@0: var storage = getCacheStorage("disk"); michael@0: storage.asyncEvictStorage( michael@0: new EvictionCallback(true, function() { michael@0: storage.asyncVisitStorage( michael@0: new VisitCallback(0, 0, [], function() { michael@0: var storage = getCacheStorage("memory"); michael@0: storage.asyncVisitStorage( michael@0: new VisitCallback(0, 0, [], function() { michael@0: finish_cache2_test(); michael@0: }), michael@0: true michael@0: ); michael@0: }), michael@0: true michael@0: ); michael@0: }) michael@0: ); michael@0: }, !newCacheBackEndUsed()); michael@0: michael@0: asyncOpenCacheEntry("http://mem1/", "memory", Ci.nsICacheStorage.OPEN_NORMALLY, null, michael@0: new OpenCallback(NEW, "m2m", "m2d", function(entry) { michael@0: asyncOpenCacheEntry("http://mem1/", "memory", Ci.nsICacheStorage.OPEN_NORMALLY, null, michael@0: new OpenCallback(NORMAL, "m2m", "m2d", function(entry) { michael@0: mc.fired(); michael@0: }) michael@0: ); michael@0: }) michael@0: ); michael@0: michael@0: asyncOpenCacheEntry("http://a/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null, michael@0: new OpenCallback(NEW, "a1m", "a1d", function(entry) { michael@0: asyncOpenCacheEntry("http://a/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null, michael@0: new OpenCallback(NORMAL, "a1m", "a1d", function(entry) { michael@0: mc.fired(); michael@0: }) michael@0: ); michael@0: }) michael@0: ); michael@0: michael@0: asyncOpenCacheEntry("http://b/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null, michael@0: new OpenCallback(NEW, "b1m", "b1d", function(entry) { michael@0: asyncOpenCacheEntry("http://b/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null, michael@0: new OpenCallback(NORMAL, "b1m", "b1d", function(entry) { michael@0: mc.fired(); michael@0: }) michael@0: ); michael@0: }) michael@0: ); michael@0: michael@0: do_test_pending(); michael@0: }