Bug 1931425 - Limit how often moz-label's #setStyles runs r=reusable-components-revie...
[gecko.git] / netwerk / test / unit / test_cache2-24-exists.js
blob662a9b5139d5fde33a2f573e2ec86b3ff8222ca3
1 "use strict";
3 function run_test() {
4 do_get_profile();
6 var mc = new MultipleCallbacks(2, function () {
7 var mem = getCacheStorage("memory");
8 var disk = getCacheStorage("disk");
10 Assert.ok(disk.exists(createURI("http://m1/"), ""));
11 Assert.ok(mem.exists(createURI("http://m1/"), ""));
12 Assert.ok(!mem.exists(createURI("http://m2/"), ""));
13 Assert.ok(disk.exists(createURI("http://d1/"), ""));
14 do_check_throws_nsIException(
15 () => disk.exists(createURI("http://d2/"), ""),
16 "NS_ERROR_NOT_AVAILABLE"
19 finish_cache2_test();
20 });
22 asyncOpenCacheEntry(
23 "http://d1/",
24 "disk",
25 Ci.nsICacheStorage.OPEN_NORMALLY,
26 Services.loadContextInfo.default,
27 new OpenCallback(NEW | WAITFORWRITE, "meta", "data", function () {
28 mc.fired();
32 asyncOpenCacheEntry(
33 "http://m1/",
34 "memory",
35 Ci.nsICacheStorage.OPEN_NORMALLY,
36 Services.loadContextInfo.default,
37 new OpenCallback(NEW | WAITFORWRITE, "meta", "data", function () {
38 mc.fired();
42 do_test_pending();