summaryrefslogtreecommitdiffstats
path: root/toolkit/components/antitracking/test/browser/browser_storageAccessDeniedGivesNoUserInteraction.js
blob: dff3aa89701eccd359219a64966146ec13f62012 (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
Services.scriptloader.loadSubScript(
  "chrome://mochitests/content/browser/browser/modules/test/browser/head.js",
  this
);
/* import-globals-from ../../../../../browser/modules/test/browser/head.js */
Services.scriptloader.loadSubScript(
  "chrome://mochitests/content/browser/toolkit/components/antitracking/test/browser/storage_access_head.js",
  this
);
/* import-globals-from storage_access_head.js */
/* import-globals-from head.js */

add_task(async function testGrantGivesPermission() {
  await setPreferences();

  await openPageAndRunCode(
    TEST_TOP_PAGE,
    getExpectPopupAndClick("reject"),
    TEST_3RD_PARTY_PAGE,
    requestStorageAccessAndExpectFailure
  );

  await SpecialPowers.testPermission(
    "storageAccessAPI",
    SpecialPowers.Services.perms.UNKNOWN_ACTION,
    {
      url: "https://tracking.example.org/",
    }
  );

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