Bug 1762462 - Make tests in dom/workers/test/ reflect Always Partitioning Storage; r=smaug

Depends on D148057

Differential Revision: https://phabricator.services.mozilla.com/D148058
This commit is contained in:
Thomas Wisniewski 2022-07-14 19:26:30 +00:00
Родитель 891b027c4e
Коммит 800971d7fd
4 изменённых файлов: 31 добавлений и 16 удалений

Просмотреть файл

@ -127,7 +127,10 @@
SpecialPowers.pushPermissions([{'type': 'storageAccessAPI', 'allow': 1, 'context': document}], () =>{
SpecialPowers.wrap(document).requestStorageAccess().then(() => {
// If Fission is disabled, the pref is no-op.
SpecialPowers.pushPrefEnv({set: [["fission.bfcacheInParent", true]]}, () => {
SpecialPowers.pushPrefEnv({set: [
["fission.bfcacheInParent", true],
["privacy.partition.always_partition_third_party_non_cookie_storage", false],
]}, () => {
testGenerator.next();
});
}).then(() => {

Просмотреть файл

@ -104,6 +104,9 @@
// the iframe containing this page is isolated from first-party storage access,
// which isolates BroadcastChannel communication.
SpecialPowers.wrap(document).notifyUserGestureActivation();
SpecialPowers.pushPrefEnv({
set: [["privacy.partition.always_partition_third_party_non_cookie_storage", false]],
}).then(() => {
SpecialPowers.pushPermissions([{'type': 'storageAccessAPI', 'allow': 1, 'context': document}], () =>{
SpecialPowers.wrap(document).requestStorageAccess().then(() => {
runTest();
@ -111,6 +114,7 @@
SpecialPowers.removePermission("3rdPartyStorage^http://mochi.test:8888", "http://mochi.xorigin-test:8888");
});
});
});
} else {
runTest();
}

Просмотреть файл

@ -122,6 +122,9 @@
// the iframe containing this page is isolated from first-party storage access,
// which isolates BroadcastChannel communication.
SpecialPowers.wrap(document).notifyUserGestureActivation();
SpecialPowers.pushPrefEnv({
set: [["privacy.partition.always_partition_third_party_non_cookie_storage", false]],
}).then(() => {
SpecialPowers.pushPermissions([{'type': 'storageAccessAPI', 'allow': 1, 'context': document}], () =>{
SpecialPowers.wrap(document).requestStorageAccess().then(() => {
runTest();
@ -129,6 +132,7 @@
SpecialPowers.removePermission("3rdPartyStorage^http://mochi.test:8888", "http://mochi.xorigin-test:8888");
});
});
});
} else {
runTest();
}

Просмотреть файл

@ -167,6 +167,9 @@
// the iframe containing this page is isolated from first-party storage access,
// which isolates BroadcastChannel communication.
SpecialPowers.wrap(document).notifyUserGestureActivation();
SpecialPowers.pushPrefEnv({
set: [["privacy.partition.always_partition_third_party_non_cookie_storage", false]],
}).then(() => {
SpecialPowers.pushPermissions([{'type': 'storageAccessAPI', 'allow': 1, 'context': document}], () =>{
SpecialPowers.wrap(document).requestStorageAccess().then(() => {
runTest();
@ -174,6 +177,7 @@
SpecialPowers.removePermission("3rdPartyStorage^http://mochi.test:8888", "http://mochi.xorigin-test:8888");
});
});
});
} else {
runTest();
}