Bug 1937121, part 1 - Remove storage unpartitioning from dom tests - r=smaug

Similar to another recent patch, this removes uses of
SimpleTest.enableLegacyUnpartitionedStorage for the new BroadcastChannel.unpartitionedTestingChannel.

One exception is test_bug458091.html, which I just disable for xorigin.
It really doesn't need the xorigin coverage imo. It is testing that
sessionStorage uses principals, not just the Document URI.

Differential Revision: https://phabricator.services.mozilla.com/D242942
This commit is contained in:
Benjamin VanderSloot
2025-04-07 12:37:46 +00:00
parent dfad607623
commit b687f6b23b
8 changed files with 12 additions and 15 deletions

View File

@@ -3,7 +3,7 @@
<script>
onload = function() {
function done(success) {
var bc = new BroadcastChannel("test_channel");
var bc = SpecialPowers.wrap(BroadcastChannel).unpartitionedTestingChannel("test_channel");
bc.postMessage({success});
bc.close();
}

View File

@@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1384658
/** Test for Bug 1384658 **/
function test_frameset() {
var bc = new BroadcastChannel("test_channel");
var bc = SpecialPowers.wrap(BroadcastChannel).unpartitionedTestingChannel("test_channel");
bc.postMessage("go");
bc.onmessage = ev => {
ok(ev.data.success, "We didn't hang");
@@ -25,7 +25,7 @@ function test_frameset() {
function test_window() {
var win = window.open("http://example.com/tests/dom/websocket/tests/window_bug1384658.html",
"_blank", "width=100,height=100");
var bc = new BroadcastChannel("test_channel");
var bc = SpecialPowers.wrap(BroadcastChannel).unpartitionedTestingChannel("test_channel");
bc.onmessage = ev => {
ok(ev.data.success, "We didn't hang");
bc.close();
@@ -41,8 +41,6 @@ SpecialPowers.pushPrefEnv({
set: [
["network.cookie.cookieBehavior", 4],
// disable third-party storage isolation so the test works as expected
["privacy.partition.always_partition_third_party_non_cookie_storage", false],
["privacy.restrict3rdpartystorage.heuristic.window_open", true],
["dom.security.https_first", false]
],
}, test_frameset);