summaryrefslogtreecommitdiffstats
path: root/toolkit/components/antitracking/test/browser/browser_storageAccessDeniedGivesNoUserInteraction.js
blob: cf47c43a1454696995bda64ecdb63757d0314755 (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
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 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();
});