Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / netwerk / test / unit / test_cache2-20-range-200.js
bloba3f2dc379ec624d54d1eea6674cabbe71485aecb
1 "use strict";
3 function run_test() {
4 do_get_profile();
6 // Open for write, write
7 asyncOpenCacheEntry(
8 "http://r200/",
9 "disk",
10 Ci.nsICacheStorage.OPEN_NORMALLY,
11 null,
12 new OpenCallback(NEW, "200m1", "200part1a-", function () {
13 // Open normally but wait for validation from the server
14 asyncOpenCacheEntry(
15 "http://r200/",
16 "disk",
17 Ci.nsICacheStorage.OPEN_NORMALLY,
18 null,
19 new OpenCallback(PARTIAL, "200m1", "200part1a-", function (entry) {
20 // emulate 200 from the server, i.e. recreate the entry, resume transaction and
21 // write new content to the output stream
22 new OpenCallback(
23 NEW | WAITFORWRITE | RECREATE,
24 "200m2",
25 "200part1b--part2b",
26 function (entry1) {
27 entry1.setValid();
29 ).onCacheEntryAvailable(entry, true, Cr.NS_OK);
33 var mc = new MultipleCallbacks(3, finish_cache2_test);
35 asyncOpenCacheEntry(
36 "http://r200/",
37 "disk",
38 Ci.nsICacheStorage.OPEN_NORMALLY,
39 null,
40 new OpenCallback(NORMAL, "200m2", "200part1b--part2b", function () {
41 mc.fired();
44 asyncOpenCacheEntry(
45 "http://r200/",
46 "disk",
47 Ci.nsICacheStorage.OPEN_NORMALLY,
48 null,
49 new OpenCallback(NORMAL, "200m2", "200part1b--part2b", function () {
50 mc.fired();
53 asyncOpenCacheEntry(
54 "http://r200/",
55 "disk",
56 Ci.nsICacheStorage.OPEN_NORMALLY,
57 null,
58 new OpenCallback(NORMAL, "200m2", "200part1b--part2b", function () {
59 mc.fired();
65 do_test_pending();