6 // First check how behaves the memory storage.
11 Ci
.nsICacheStorage
.OPEN_NORMALLY
,
13 new OpenCallback(NEW
, "mem1-meta", "mem1-data", function (entryM1
) {
14 Assert
.ok(!entryM1
.persistent
);
18 Ci
.nsICacheStorage
.OPEN_NORMALLY
,
20 new OpenCallback(NORMAL
, "mem1-meta", "mem1-data", function (entryM2
) {
21 Assert
.ok(!entryM1
.persistent
);
22 Assert
.ok(!entryM2
.persistent
);
24 // Now check the disk storage behavior.
29 Ci
.nsICacheStorage
.OPEN_NORMALLY
,
31 // Must wait for write, since opening the entry as memory-only before the disk one
32 // is written would cause NS_ERROR_NOT_AVAILABLE from openOutputStream when writing
33 // this disk entry since it's doomed during opening of the memory-only entry for the same URL.
39 Assert
.ok(entryD1
.persistent
);
40 // Now open the same URL as a memory-only entry, the disk entry must be doomed.
44 Ci
.nsICacheStorage
.OPEN_NORMALLY
,
46 // This must be recreated
47 new OpenCallback(NEW
, "mem2-meta", "mem2-data", function (
50 Assert
.ok(entryD1
.persistent
);
51 Assert
.ok(!entryD2
.persistent
);
52 // Check we get it back, even when opening via the disk storage
56 Ci
.nsICacheStorage
.OPEN_NORMALLY
,
63 Assert
.ok(entryD1
.persistent
);
64 Assert
.ok(!entryD2
.persistent
);
65 Assert
.ok(!entryD3
.persistent
);