netwerk/test/unit/test_cache2-21-anon-storage.js

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     1 Components.utils.import('resource://gre/modules/LoadContextInfo.jsm');
     3 function run_test()
     4 {
     5   do_get_profile();
     7   if (!newCacheBackEndUsed()) {
     8     do_check_true(true, "This test doesn't run when the old cache back end is used since the behavior is different");
     9     return;
    10   }
    12   // Create and check an entry anon disk storage
    13   asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous,
    14     new OpenCallback(NEW, "an1", "an1", function(entry) {
    15       asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous,
    16         new OpenCallback(NORMAL, "an1", "an1", function(entry) {
    17           // Create and check an entry non-anon disk storage
    18           asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default,
    19             new OpenCallback(NEW, "na1", "na1", function(entry) {
    20               asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default,
    21                 new OpenCallback(NORMAL, "na1", "na1", function(entry) {
    22                   // check the anon entry is still there and intact
    23                   asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous,
    24                     new OpenCallback(NORMAL, "an1", "an1", function(entry) {
    25                       finish_cache2_test();
    26                     })
    27                   );
    28                 })
    29               );
    30             })
    31           );
    32         })
    33       );
    34     })
    35   );
    37   do_test_pending();
    38 }

mercurial