1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/browser/modules/test/browser/head.js",
this
);
Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/toolkit/components/antitracking/test/browser/storage_access_head.js",
this
);
add_task(async function testInitialBlock() {
await setPreferences();
await openPageAndRunCode(
TEST_TOP_PAGE_7,
getExpectPopupAndClick("reject"),
TEST_3RD_PARTY_PAGE,
requestStorageAccessAndExpectFailure
);
await cleanUpData();
await SpecialPowers.flushPrefEnv();
});
add_task(async function testDifferentSitePermission() {
await setPreferences(/*alwaysPartitionStorage*/ false);
await openPageAndRunCode(
TEST_TOP_PAGE_7,
getExpectPopupAndClick("accept"),
TEST_3RD_PARTY_PAGE,
requestStorageAccessAndExpectSuccess
);
await openPageAndRunCode(
TEST_TOP_PAGE,
getExpectPopupAndClick("reject"),
TEST_3RD_PARTY_PAGE,
requestStorageAccessAndExpectFailure
);
await cleanUpData();
await SpecialPowers.flushPrefEnv();
});
add_task(async function testDifferentSitePermissionAPS() {
await setPreferences(/*alwaysPartitionStorage*/ true);
await openPageAndRunCode(
TEST_TOP_PAGE_7,
getExpectPopupAndClick("accept"),
TEST_3RD_PARTY_PAGE,
requestStorageAccessAndExpectSuccess
);
await openPageAndRunCode(
TEST_TOP_PAGE,
getExpectPopupAndClick("reject"),
TEST_3RD_PARTY_PAGE,
requestStorageAccessAndExpectFailure
);
await cleanUpData();
await SpecialPowers.flushPrefEnv();
});
|