netwerk/test/unit/test_cache2-14-concurent-readers.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/test/unit/test_cache2-14-concurent-readers.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,31 @@
     1.4 +function run_test()
     1.5 +{
     1.6 +  do_get_profile();
     1.7 +
     1.8 +  asyncOpenCacheEntry("http://x/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
     1.9 +    new OpenCallback(NEW, "x1m", "x1d", function(entry) {
    1.10 +      // nothing to do here, we expect concurent callbacks to get
    1.11 +      // all notified, then the test finishes
    1.12 +    })
    1.13 +  );
    1.14 +
    1.15 +  var mc = new MultipleCallbacks(3, finish_cache2_test);
    1.16 +
    1.17 +  asyncOpenCacheEntry("http://x/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
    1.18 +    new OpenCallback(NORMAL, "x1m", "x1d", function(entry) {
    1.19 +      mc.fired();
    1.20 +    })
    1.21 +  );
    1.22 +  asyncOpenCacheEntry("http://x/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
    1.23 +    new OpenCallback(NORMAL, "x1m", "x1d", function(entry) {
    1.24 +      mc.fired();
    1.25 +    })
    1.26 +  );
    1.27 +  asyncOpenCacheEntry("http://x/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
    1.28 +    new OpenCallback(NORMAL, "x1m", "x1d", function(entry) {
    1.29 +      mc.fired();
    1.30 +    })
    1.31 +  );
    1.32 +
    1.33 +  do_test_pending();
    1.34 +}

mercurial