2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/publicdomain/zero/1.0/
7 * Verify that temporary storage initialization will notice a removed origin
8 * that the cache has data for and which indicates the origin was accessed
9 * during the last run. Currently, we expect LoadQuotaFromCache to fail because
10 * of this inconsistency and to fall back to full initialization.
13 async
function testSteps() {
14 const principal
= getPrincipal("http://example.com");
15 const originUsage
= 0;
19 // The packaged profile will have a different build ID and we would treat the
20 // cache as invalid if we didn't bypass this check.
21 Services
.prefs
.setBoolPref("dom.quotaManager.caching.checkBuildId", false);
25 let request
= clear();
26 await
requestFinished(request
);
28 info("Installing package");
30 // The profile contains empty default storage, a script for origin
31 // initialization and the storage database:
35 // The file create_db.js in the package was run locally, specifically it was
36 // temporarily added to xpcshell.ini and then executed:
37 // mach xpcshell-test --interactive dom/quota/test/xpcshell/create_db.js
38 // Note: to make it become the profile in the test, additional manual steps
40 // 1. Remove the folder "storage/default/http+++example.com".
41 // 2. Remove the folder "storage/temporary".
42 // 3. Remove the file "storage/ls-archive.sqlite".
43 installPackage("removedOrigin_profile");
48 await
requestFinished(request
);
50 info("Initializing temporary storage");
52 request
= initTemporaryStorage();
53 await
requestFinished(request
);
55 info("Getting origin usage");
57 request
= getCachedOriginUsage(principal
);
58 await
requestFinished(request
);
60 is(request
.result
, originUsage
, "Correct origin usage");