Bug 1740695: Update more tests within browser/components/originattributes/test/browser to work with https-first enabled r=timhuang

Differential Revision: https://phabricator.services.mozilla.com/D130970
This commit is contained in:
Christoph Kerschbaumer
2021-11-14 07:40:11 +00:00
parent b4d57851d2
commit 053bf80e3d
5 changed files with 18 additions and 6 deletions

View File

@@ -11,7 +11,10 @@ const { PermissionTestUtils } = ChromeUtils.import(
const TEST_PAGE = "http://example.net";
const uri = Services.io.newURI(TEST_PAGE);
function disableCookies() {
async function disableCookies() {
await SpecialPowers.pushPrefEnv({
set: [["dom.security.https_first", false]],
});
Services.cookies.removeAll();
PermissionTestUtils.add(uri, "cookie", Services.perms.DENY_ACTION);
@@ -50,7 +53,10 @@ IsolationTestTools.runTests(
disableCookies
);
function enableCookies() {
async function enableCookies() {
await SpecialPowers.pushPrefEnv({
set: [["dom.security.https_first", false]],
});
Services.cookies.removeAll();
PermissionTestUtils.add(uri, "cookie", Services.perms.ALLOW_ACTION);

View File

@@ -10,7 +10,10 @@ const TEST_BASE = "/browser/browser/components/originattributes/test/browser/";
add_task(async function setup() {
// Make sure first party isolation is enabled.
await SpecialPowers.pushPrefEnv({
set: [["privacy.firstparty.isolate", true]],
set: [
["privacy.firstparty.isolate", true],
["dom.security.https_first", false],
],
});
});

View File

@@ -8,7 +8,7 @@ if (SpecialPowers.useRemoteSubframes) {
const CC = Components.Constructor;
const TEST_DOMAIN = "http://example.net/";
const TEST_DOMAIN = "https://example.net/";
const { Sanitizer } = ChromeUtils.import("resource:///modules/Sanitizer.jsm");

View File

@@ -2,7 +2,7 @@
* Bug 1264593 - A test case for the shared worker by first party isolation.
*/
const TEST_DOMAIN = "http://example.net/";
const TEST_DOMAIN = "https://example.net/";
const TEST_PATH =
TEST_DOMAIN + "browser/browser/components/originattributes/test/browser/";
const TEST_PAGE = TEST_PATH + "file_sharedworker.html";

View File

@@ -84,7 +84,10 @@ add_task(async function runTests() {
// First, we test the scenario that the first party isolation is enabled.
await SpecialPowers.pushPrefEnv({
set: [["privacy.firstparty.isolate", true]],
set: [
["privacy.firstparty.isolate", true],
["dom.security.https_first", false],
],
});
for (let enabled of tests) {