summaryrefslogtreecommitdiffstats
path: root/toolkit/components/antitracking/test/browser/browser_storageAccessScopeSameSiteWrite.js
blob: 4b99cb266e098db655fc8c677c41917947d12864 (plain)
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
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 testSameSitePermissionReversed() {
  await setPreferences();

  await openPageAndRunCode(
    TEST_TOP_PAGE_8,
    getExpectPopupAndClick("accept"),
    TEST_3RD_PARTY_PAGE,
    requestStorageAccessAndExpectSuccess
  );

  await openPageAndRunCode(
    TEST_TOP_PAGE_7,
    expectNoPopup,
    TEST_3RD_PARTY_PAGE,
    requestStorageAccessAndExpectSuccess
  );

  await cleanUpData();
  await SpecialPowers.flushPrefEnv();
});