Bug 1943761 - Add class alignment to the mozsearch analysis file. r=asuth
[gecko.git] / dom / quota / test / xpcshell / test_initializeTemporaryClient.js
blobf721560bda65cefa627236ac98c0bc0bec042163
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 initializeTemporaryClient() does call
8 * QuotaManager::EnsureTemporaryClientIsInitialized() which ensures client
9 * directory existence.
12 async function testSteps() {
13 const clientMetadata = {
14 persistence: "default",
15 principal: getPrincipal("https://foo.example.com"),
16 client: "sdb",
17 file: getRelativeFile("storage/default/https+++foo.example.com/sdb"),
20 info("Clearing");
22 let request = clear();
23 await requestFinished(request);
25 info("Initializing");
27 request = init();
28 await requestFinished(request);
30 info("Initializing temporary storage");
32 request = initTemporaryStorage();
33 await requestFinished(request);
35 info("Initializing temporary origin");
37 request = initTemporaryOrigin(
38 clientMetadata.persistence,
39 clientMetadata.principal
41 await requestFinished(request);
43 ok(!clientMetadata.file.exists(), "Client directory does not exist");
45 info("Initializing temporary client");
47 request = initTemporaryClient(
48 clientMetadata.persistence,
49 clientMetadata.principal,
50 clientMetadata.client
52 await requestFinished(request);
54 ok(clientMetadata.file.exists(), "Client directory does exist");