Bug 1943761 - Add class alignment to the mozsearch analysis file. r=asuth
[gecko.git] / dom / quota / test / xpcshell / test_initializeTemporaryOrigin.js
blobb6f6110fd84805504122710f1498af64133d654a
1 /**
2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/publicdomain/zero/1.0/
4 */
6 /**
7 * This test is mainly to verify that initializeTemporaryOrigin() does call
8 * QuotaManager::EnsureTemporaryOriginIsInitialized() which ensures origin
9 * directory existence.
12 async function testSteps() {
13 const originMetadata = {
14 persistence: "default",
15 principal: getPrincipal("https://foo.example.com"),
16 file: getRelativeFile("storage/default/https+++foo.example.com"),
19 info("Clearing");
21 let request = clear();
22 await requestFinished(request);
24 info("Initializing");
26 request = init();
27 await requestFinished(request);
29 info("Initializing temporary storage");
31 request = initTemporaryStorage();
32 await requestFinished(request);
34 info("Initializing temporary origin");
36 ok(!originMetadata.file.exists(), "Origin directory does not exist");
38 request = initTemporaryOrigin(
39 originMetadata.persistence,
40 originMetadata.principal
42 await requestFinished(request);
44 ok(originMetadata.file.exists(), "Origin directory does exist");
46 info("Verifying temporary origin initialization status");
48 request = temporaryOriginInitialized(
49 originMetadata.persistence,
50 originMetadata.principal
52 await requestFinished(request);
54 ok(request.result, "Temporary origin is initialized");