netwerk/test/unit/test_cache2-02-open-non-existing.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/test/unit/test_cache2-02-open-non-existing.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,28 @@
     1.4 +function run_test()
     1.5 +{
     1.6 +  do_get_profile();
     1.7 +
     1.8 +  // Open non-existing for read, should fail
     1.9 +  asyncOpenCacheEntry("http://b/", "disk", Ci.nsICacheStorage.OPEN_READONLY, null,
    1.10 +    new OpenCallback(NOTFOUND, null, null, function(entry) {
    1.11 +      // Open the same non-existing for read again, should fail second time
    1.12 +      asyncOpenCacheEntry("http://b/", "disk", Ci.nsICacheStorage.OPEN_READONLY, null,
    1.13 +        new OpenCallback(NOTFOUND, null, null, function(entry) {
    1.14 +          // Try it again normally, should go
    1.15 +          asyncOpenCacheEntry("http://b/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
    1.16 +            new OpenCallback(NEW, "b1m", "b1d", function(entry) {
    1.17 +              // ...and check
    1.18 +              asyncOpenCacheEntry("http://b/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
    1.19 +                new OpenCallback(NORMAL, "b1m", "b1d", function(entry) {
    1.20 +                  finish_cache2_test();
    1.21 +                })
    1.22 +              );
    1.23 +            })
    1.24 +          );
    1.25 +        })
    1.26 +      );
    1.27 +    })
    1.28 +  );
    1.29 +
    1.30 +  do_test_pending();
    1.31 +}

mercurial