michael@0: Components.utils.import('resource://gre/modules/LoadContextInfo.jsm'); michael@0: 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: // Create and check an entry anon disk storage michael@0: asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous, michael@0: new OpenCallback(NEW, "an1", "an1", function(entry) { michael@0: asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous, michael@0: new OpenCallback(NORMAL, "an1", "an1", function(entry) { michael@0: // Create and check an entry non-anon disk storage michael@0: asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default, michael@0: new OpenCallback(NEW, "na1", "na1", function(entry) { michael@0: asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default, michael@0: new OpenCallback(NORMAL, "na1", "na1", function(entry) { michael@0: // check the anon entry is still there and intact michael@0: asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous, michael@0: new OpenCallback(NORMAL, "an1", "an1", function(entry) { michael@0: finish_cache2_test(); michael@0: }) michael@0: ); michael@0: }) michael@0: ); michael@0: }) michael@0: ); michael@0: }) michael@0: ); michael@0: }) michael@0: ); michael@0: michael@0: do_test_pending(); michael@0: }