Bug 1943761 - Add class alignment to the mozsearch analysis file. r=asuth
[gecko.git] / dom / quota / test / xpcshell / test_initTemporaryStorage.js
blob085cca50a240d783970df0d55e79fa2c08052975
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 initTemporaryStorage() does call
8 * QuotaManager::EnsureTemporaryStorageIsInitializedInternal() which does
9 * various things, for example, it restores the directory metadata if it's
10 * broken or missing.
13 async function testSteps() {
14 const originDirPath = "storage/default/https+++foo.example.com";
15 const metadataFileName = ".metadata-v2";
17 info("Initializing");
19 let request = init();
20 await requestFinished(request);
22 info("Verifying initialization status");
24 await verifyInitializationStatus(true, false, false);
26 info("Creating an empty directory");
28 let originDir = getRelativeFile(originDirPath);
29 originDir.create(Ci.nsIFile.DIRECTORY_TYPE, parseInt("0755", 8));
31 info("Initializing the temporary storage");
33 request = initTemporaryStorage();
34 await requestFinished(request);
36 info(
37 "Verifying directory metadata was restored after calling " +
38 "initTemporaryStorage()"
41 let metadataFile = originDir.clone();
42 metadataFile.append(metadataFileName);
44 ok(metadataFile.exists(), "Directory metadata file does exist");
46 info("Verifying initialization status");
48 await verifyInitializationStatus(true, false, true);