Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 function run_test()
2 {
3 do_get_profile();
5 asyncOpenCacheEntry("http://x/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
6 new OpenCallback(NEW, "x1m", "x1d", function(entry) {
7 // nothing to do here, we expect concurent callbacks to get
8 // all notified, then the test finishes
9 })
10 );
12 var mc = new MultipleCallbacks(3, finish_cache2_test);
14 var order = 0;
16 asyncOpenCacheEntry("http://x/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
17 new OpenCallback(NORMAL|COMPLETE, "x1m", "x1d", function(entry) {
18 ++order;
19 do_check_eq(order, newCacheBackEndUsed() ? 3 : 1);
20 mc.fired();
21 })
22 );
23 asyncOpenCacheEntry("http://x/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
24 new OpenCallback(NORMAL, "x1m", "x1d", function(entry) {
25 ++order;
26 do_check_eq(order, newCacheBackEndUsed() ? 1 : 2);
27 mc.fired();
28 })
29 );
30 asyncOpenCacheEntry("http://x/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
31 new OpenCallback(NORMAL, "x1m", "x1d", function(entry) {
32 ++order;
33 do_check_eq(order, newCacheBackEndUsed() ? 2 : 3);
34 mc.fired();
35 })
36 );
38 do_test_pending();
39 }