Bug 1498466 - Ensure that hasStorageAccess() returns a sensible value with cookieBehavior set to accept all cookies r=baku

Differential Revision: https://phabricator.services.mozilla.com/D8584

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ehsan Akhgari 2018-10-15 10:36:48 +00:00
parent e38073ca8f
commit bd4eab0ff0
2 changed files with 4 additions and 3 deletions

View File

@ -13806,6 +13806,7 @@ nsIDocument::RequestStorageAccess(mozilla::ErrorResult& aRv)
promise->MaybeRejectWithUndefined();
});
} else {
outer->SetHasStorageAccess(true);
promise->MaybeResolveWithUndefined();
}
}

View File

@ -62,7 +62,7 @@ async function callRequestStorageAccess(callback) {
}
ok(success, "Should not have thrown");
await noStorageAccessInitially();
await hasStorageAccessInitially();
await interactWithTracker();
@ -89,11 +89,11 @@ async function callRequestStorageAccess(callback) {
rejected = true;
}
success = rejectTrackers && !threw && !rejected;
success = !threw && !rejected;
let hasAccess = await document.hasStorageAccess();
is(hasAccess, success,
"Should " + (success ? "" : "not ") + "have storage access now");
if (success) {
if (success && rejectTrackers) {
// Wait until the permission is visible in our process to avoid race
// conditions.
await waitUntilPermission("http://example.net/browser/toolkit/components/antitracking/test/browser/page.html",