1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/test/unit/test_cache2-21-anon-storage.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,38 @@ 1.4 +Components.utils.import('resource://gre/modules/LoadContextInfo.jsm'); 1.5 + 1.6 +function run_test() 1.7 +{ 1.8 + do_get_profile(); 1.9 + 1.10 + if (!newCacheBackEndUsed()) { 1.11 + do_check_true(true, "This test doesn't run when the old cache back end is used since the behavior is different"); 1.12 + return; 1.13 + } 1.14 + 1.15 + // Create and check an entry anon disk storage 1.16 + asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous, 1.17 + new OpenCallback(NEW, "an1", "an1", function(entry) { 1.18 + asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous, 1.19 + new OpenCallback(NORMAL, "an1", "an1", function(entry) { 1.20 + // Create and check an entry non-anon disk storage 1.21 + asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default, 1.22 + new OpenCallback(NEW, "na1", "na1", function(entry) { 1.23 + asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default, 1.24 + new OpenCallback(NORMAL, "na1", "na1", function(entry) { 1.25 + // check the anon entry is still there and intact 1.26 + asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous, 1.27 + new OpenCallback(NORMAL, "an1", "an1", function(entry) { 1.28 + finish_cache2_test(); 1.29 + }) 1.30 + ); 1.31 + }) 1.32 + ); 1.33 + }) 1.34 + ); 1.35 + }) 1.36 + ); 1.37 + }) 1.38 + ); 1.39 + 1.40 + do_test_pending(); 1.41 +}