Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- Manifest: netwerk/test/unit/xpcshell.toml
"use strict";
function run_test() {
do_get_profile();
// Add entry to the memory storage
var mc = new MultipleCallbacks(5, function () {
// Check it's there by visiting the storage
syncWithCacheIOThread(function () {
var storage = getCacheStorage("memory");
storage.asyncVisitStorage(
storage = getCacheStorage("disk");
storage.asyncVisitStorage(
// Previous tests should store 4 disk entries
new VisitCallback(
4,
4096,
function () {
finish_cache2_test();
}
),
true
);
}),
true
);
});
});
asyncOpenCacheEntry(
"memory",
Ci.nsICacheStorage.OPEN_NORMALLY,
null,
new OpenCallback(NEW, "m1m", "m1d", function () {
asyncOpenCacheEntry(
"memory",
Ci.nsICacheStorage.OPEN_NORMALLY,
null,
new OpenCallback(NORMAL, "m1m", "m1d", function () {
mc.fired();
})
);
})
);
asyncOpenCacheEntry(
"disk",
Ci.nsICacheStorage.OPEN_NORMALLY,
null,
new OpenCallback(NEW, "a1m", "a1d", function () {
asyncOpenCacheEntry(
"disk",
Ci.nsICacheStorage.OPEN_NORMALLY,
null,
new OpenCallback(NORMAL, "a1m", "a1d", function () {
mc.fired();
})
);
})
);
asyncOpenCacheEntry(
"disk",
Ci.nsICacheStorage.OPEN_NORMALLY,
null,
new OpenCallback(NEW, "a1m", "a1d", function () {
asyncOpenCacheEntry(
"disk",
Ci.nsICacheStorage.OPEN_NORMALLY,
null,
new OpenCallback(NORMAL, "a1m", "a1d", function () {
mc.fired();
})
);
})
);
asyncOpenCacheEntry(
"disk",
Ci.nsICacheStorage.OPEN_NORMALLY,
null,
new OpenCallback(NEW, "a1m", "a1d", function () {
asyncOpenCacheEntry(
"disk",
Ci.nsICacheStorage.OPEN_NORMALLY,
null,
new OpenCallback(NORMAL, "a1m", "a1d", function () {
mc.fired();
})
);
})
);
asyncOpenCacheEntry(
"disk",
Ci.nsICacheStorage.OPEN_NORMALLY,
null,
new OpenCallback(NEW, "a1m", "a1d", function () {
asyncOpenCacheEntry(
"disk",
Ci.nsICacheStorage.OPEN_NORMALLY,
null,
new OpenCallback(NORMAL, "a1m", "a1d", function () {
mc.fired();
})
);
})
);
do_test_pending();
}