Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / netwerk / test / unit / test_cache2-01e-basic-bypass-if-busy.js
blobe77e7afdfca7059ca44f15b5456ffdf0dc75ce73
1 "use strict";
3 function run_test() {
4 do_get_profile();
6 // Open for write, delay the actual write
7 asyncOpenCacheEntry(
8 "http://a/",
9 "disk",
10 Ci.nsICacheStorage.OPEN_NORMALLY,
11 null,
12 new OpenCallback(NEW | DONTFILL, "a1m", "a1d", function () {
13 var bypassed = false;
15 // Open and bypass
16 asyncOpenCacheEntry(
17 "http://a/",
18 "disk",
19 Ci.nsICacheStorage.OPEN_BYPASS_IF_BUSY,
20 null,
21 new OpenCallback(NOTFOUND, "", "", function () {
22 Assert.ok(!bypassed);
23 bypassed = true;
27 // do_execute_soon for two reasons:
28 // 1. we want finish_cache2_test call for sure after do_test_pending, but all the callbacks here
29 // may invoke synchronously
30 // 2. precaution when the OPEN_BYPASS_IF_BUSY invocation become a post one day
31 executeSoon(function () {
32 Assert.ok(bypassed);
33 finish_cache2_test();
34 });
38 do_test_pending();