2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/publicdomain/zero/1.0/
6 async
function testSteps() {
7 const baseRelativePath
= "storage/default";
8 const userContextForRemoval
= 2;
13 baseDirName
: "https+++example.com",
17 userContextId
: userContextForRemoval
,
18 baseDirName
: "https+++example.com",
21 // TODO: Uncomment this once bug 1638831 is fixed.
24 userContextId: userContextForRemoval,
25 baseDirName: "https+++example.org",
30 function getOriginDirectory(origin
) {
31 return getRelativeFile(
32 `${baseRelativePath}/${origin.baseDirName}^userContextId=` +
33 `${origin.userContextId}`
38 await
requestFinished(request
);
40 for (const origin
of origins
) {
41 const directory
= getOriginDirectory(origin
);
42 directory
.create(Ci
.nsIFile
.DIRECTORY_TYPE
, parseInt("0755", 8));
45 request
= Services
.qms
.clearStoragesForOriginAttributesPattern(
46 `{ "userContextId": ${userContextForRemoval} }`
48 await
requestFinished(request
);
50 for (const origin
of origins
) {
51 const directory
= getOriginDirectory(origin
);
52 if (origin
.userContextId
=== userContextForRemoval
) {
53 ok(!directory
.exists(), "Origin directory should have been removed");
55 ok(directory
.exists(), "Origin directory shouldn't have been removed");