Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'linux' && os_version == '18.04' && asan OR os == 'linux' && os_version == '18.04' && tsan OR debug
- Manifest: toolkit/components/antitracking/test/browser/browser.toml
Services.scriptloader.loadSubScript(
this
);
Services.scriptloader.loadSubScript(
this
);
/* import-globals-from storageAccessAPIHelpers.js */
async function testEmbeddedPageBehavior() {
SpecialPowers.wrap(document).notifyUserGestureActivation();
var p = document.requestStorageAccess();
try {
await p;
ok(true, "gain storage access.");
} catch {
ok(false, "denied storage access.");
}
SpecialPowers.wrap(document).clearUserGestureActivation();
waitUntilPermission(
"storageAccessAPI",
SpecialPowers.Services.perms.ALLOW_ACTION
);
}
add_task(async function testGrantGivesPermission() {
await setPreferences();
await openPageAndRunCode(
TEST_TOP_PAGE,
getExpectPopupAndClick("accept"),
TEST_3RD_PARTY_PAGE,
testEmbeddedPageBehavior
);
await cleanUpData();
await SpecialPowers.flushPrefEnv();
});