Bug 1910886 - Reduce duplicated code between CookieService and CookieServiceChild - part 3 - Fix gtests, r=edgul
Differential Revision: https://phabricator.services.mozilla.com/D218314
This commit is contained in:
@@ -6611,19 +6611,23 @@ void Document::GetCookie(nsAString& aCookie, ErrorResult& aRv) {
|
||||
return;
|
||||
}
|
||||
|
||||
StorageAccess storageAccess = CookieAllowedForDocument(this);
|
||||
if (storageAccess == StorageAccess::eDeny) {
|
||||
return;
|
||||
}
|
||||
// GTests do not create an inner window and because of these a few security
|
||||
// checks will block this method.
|
||||
if (!StaticPrefs::dom_cookie_testing_enabled()) {
|
||||
StorageAccess storageAccess = CookieAllowedForDocument(this);
|
||||
if (storageAccess == StorageAccess::eDeny) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ShouldPartitionStorage(storageAccess) &&
|
||||
!StoragePartitioningEnabled(storageAccess, CookieJarSettings())) {
|
||||
return;
|
||||
}
|
||||
if (ShouldPartitionStorage(storageAccess) &&
|
||||
!StoragePartitioningEnabled(storageAccess, CookieJarSettings())) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If the document is a cookie-averse Document... return the empty string.
|
||||
if (IsCookieAverse()) {
|
||||
return;
|
||||
// If the document is a cookie-averse Document... return the empty string.
|
||||
if (IsCookieAverse()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// not having a cookie service isn't an error
|
||||
|
||||
Reference in New Issue
Block a user