Bug 1762462 - Make tests in dom/cache/test/mochitest/ reflect Always Partitioning Storage; r=asuth

Depends on D148048

Differential Revision: https://phabricator.services.mozilla.com/D148049
This commit is contained in:
Thomas Wisniewski 2022-07-13 22:45:00 +00:00
Родитель f3007fdf53
Коммит 18b293b49f
8 изменённых файлов: 23 добавлений и 9 удалений

4
dom/cache/test/mochitest/driver.js поставляемый
Просмотреть файл

@ -34,6 +34,10 @@ function runTests(testFile, order) {
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
["dom.serviceWorkers.exemptFromPerDomainMax", true],
[
"privacy.partition.always_partition_third_party_non_cookie_storage",
false,
],
],
});
}

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

@ -90,7 +90,8 @@ SpecialPowers.pushPrefEnv({
"set": [["dom.caches.enabled", true],
["dom.caches.testing.enabled", true],
["dom.quotaManager.testing", true],
["dom.storageManager.enabled", true]],
["dom.storageManager.enabled", true],
["privacy.partition.always_partition_third_party_non_cookie_storage", false]],
}, async function() {
// Bug 1746646: Make mochitests work with TCP enabled (cookieBehavior = 5)
// Acquire storage access permission here so that the Cache API is avaialable

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

@ -63,7 +63,8 @@ SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({
"set": [["dom.caches.enabled", true],
["dom.caches.testing.enabled", true],
["dom.quotaManager.testing", true]],
["dom.quotaManager.testing", true],
["privacy.partition.always_partition_third_party_non_cookie_storage", false]],
}, async function() {
// Bug 1746646: Make mochitests work with TCP enabled (cookieBehavior = 5)
// Acquire storage access permission here so that the Cache API is avaialable

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

@ -87,7 +87,8 @@ SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({
"set": [["dom.caches.enabled", true],
["dom.caches.testing.enabled", true],
["dom.quotaManager.testing", true]],
["dom.quotaManager.testing", true],
["privacy.partition.always_partition_third_party_non_cookie_storage", false]],
}, async function() {
// This test is mainly to verify we only generate different padding size for
// the opaque response which is comming from netwrok.

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

@ -63,7 +63,8 @@ SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({
"set": [["dom.caches.enabled", true],
["dom.caches.testing.enabled", true],
["dom.quotaManager.testing", true]],
["dom.quotaManager.testing", true],
["privacy.partition.always_partition_third_party_non_cookie_storage", false]],
}, async function() {
// Bug 1746646: Make mochitests work with TCP enabled (cookieBehavior = 5)
// Acquire storage access permission here so that the Cache API is avaialable

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

@ -89,7 +89,8 @@ SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({
"set": [["dom.caches.enabled", true],
["dom.caches.testing.enabled", true],
["dom.quotaManager.testing", true]],
["dom.quotaManager.testing", true],
["privacy.partition.always_partition_third_party_non_cookie_storage", false]],
}, async function() {
// Bug 1746646: Make mochitests work with TCP enabled (cookieBehavior = 5)
// Acquire storage access permission here so that the Cache API is avaialable

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

@ -83,7 +83,8 @@ SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({
"set": [["dom.caches.enabled", true],
["dom.caches.testing.enabled", true],
["dom.quotaManager.testing", true]],
["dom.quotaManager.testing", true],
["privacy.partition.always_partition_third_party_non_cookie_storage", false]],
}, async function() {
// Bug 1746646: Make mochitests work with TCP enabled (cookieBehavior = 5)
// Acquire storage access permission here so that the Cache API is avaialable

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

@ -44,10 +44,14 @@ async function test() {
// Bug 1746646: Make mochitests work with TCP enabled (cookieBehavior = 5)
// Acquire storage access permission here so that the Cache API is avaialable
SpecialPowers.wrap(document).notifyUserGestureActivation();
SpecialPowers.addPermission("storageAccessAPI", true, window.location.href).then(() => {
SpecialPowers.addPermission("storageAccessAPI", true, window.location.href).then(() => {
SpecialPowers.wrap(document).requestStorageAccess().then(() => {
SpecialPowers.pushPrefEnv({
set: [["privacy.partition.always_partition_third_party_non_cookie_storage", false]],
}).then(() => {
test();
});
});
});
</script>
</body>