Bug 1943761 - Add class alignment to the mozsearch analysis file. r=asuth
[gecko.git] / dom / quota / test / xpcshell / test_initializePersistentOrigin.js
blob60ea5408c9c1d7658c84a59f7b77acb72f1dde5f
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 initializePersistentOrigin() does call
8 * QuotaManager::EnsurePersistentOriginIsInitialized() which ensures origin
9 * directory existence.
12 async function testSteps() {
13 const originMetadata = {
14 principal: getPrincipal("https://foo.example.com"),
15 file: getRelativeFile("storage/permanent/https+++foo.example.com"),
18 info("Clearing");
20 let request = clear();
21 await requestFinished(request);
23 info("Initializing");
25 request = init();
26 await requestFinished(request);
28 info("Initializing persistent origin");
30 ok(!originMetadata.file.exists(), "Origin directory does not exist");
32 request = initPersistentOrigin(originMetadata.principal);
33 await requestFinished(request);
35 ok(originMetadata.file.exists(), "Origin directory does exist");
37 info("Verifying persistent origin initialization status");
39 request = persistentOriginInitialized(originMetadata.principal);
40 await requestFinished(request);
42 ok(request.result, "Persistent origin is initialized");