mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1922020, part 2 - Remove reliance on window.opener storage access heuristic in user.js from docshell/test/mochitest - r=smaug
The helper function here is derived from code you helped design when we were first enabling TCP in xorigin mochitests Differential Revision: https://phabricator.services.mozilla.com/D224807
This commit is contained in:
parent
ba2ebf9dfe
commit
3b345a9b6d
@ -26,6 +26,8 @@
|
||||
});
|
||||
}
|
||||
async function runTest() {
|
||||
await SimpleTest.enableLegacyUnpartitionedStorage();
|
||||
|
||||
let outerBC = new BroadcastChannel("bug1740516_1");
|
||||
let innerBC = new BroadcastChannel("bug1740516_1_inner");
|
||||
|
||||
|
@ -11,7 +11,9 @@
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function runTest() {
|
||||
async function runTest() {
|
||||
await SimpleTest.enableLegacyUnpartitionedStorage();
|
||||
|
||||
let bc = new BroadcastChannel("bug1741132");
|
||||
|
||||
// Setting the pref to 0 should evict all content viewers.
|
||||
|
@ -8,7 +8,9 @@
|
||||
<script>
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function runTest() {
|
||||
async function runTest() {
|
||||
await SimpleTest.enableLegacyUnpartitionedStorage();
|
||||
|
||||
let bc = new BroadcastChannel("bug1743353");
|
||||
new Promise((resolve) => {
|
||||
bc.addEventListener("message", () => {
|
||||
|
@ -8,7 +8,9 @@
|
||||
<script>
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function runTest() {
|
||||
async function runTest() {
|
||||
await SimpleTest.enableLegacyUnpartitionedStorage();
|
||||
|
||||
let bc = new BroadcastChannel("bug1747033");
|
||||
new Promise(resolve => {
|
||||
bc.addEventListener("message", ({ data: { historyLength } }) => {
|
||||
|
@ -21,6 +21,8 @@
|
||||
});
|
||||
}
|
||||
async function runTest() {
|
||||
await SimpleTest.enableLegacyUnpartitionedStorage();
|
||||
|
||||
let bc = new BroadcastChannel("bug1743353");
|
||||
|
||||
let getData = waitForData(bc);
|
||||
|
@ -15,6 +15,8 @@
|
||||
}
|
||||
|
||||
async function runTest() {
|
||||
await SimpleTest.enableLegacyUnpartitionedStorage();
|
||||
|
||||
let bc = new BroadcastChannel("bug1850335");
|
||||
|
||||
// Load the first page.
|
||||
|
@ -43,31 +43,33 @@ var innerHTML =
|
||||
// eslint-disable-next-line no-useless-concat
|
||||
+ `script></head>`
|
||||
;
|
||||
var bc_multipart = new BroadcastChannel("bug660404_multipart");
|
||||
bc_multipart.onmessage = (msgEvent) => {
|
||||
var msg = msgEvent.data;
|
||||
var command = msg.command;
|
||||
if (command == "finishTest") {
|
||||
is(msg.textContent, textContent);
|
||||
is(msg.innerHTML, innerHTML);
|
||||
bc_multipart.close();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
var bc = new BroadcastChannel("bug660404");
|
||||
bc.onmessage = (msgEvent) => {
|
||||
var msg = msgEvent.data;
|
||||
var command = msg.command;
|
||||
if (command == "pagehide") {
|
||||
is(msg.persisted, true, "Should be bfcached when navigating to multipart");
|
||||
bc.close();
|
||||
}
|
||||
}
|
||||
|
||||
// If Fission is disabled, the pref is no-op.
|
||||
SpecialPowers.pushPrefEnv({set: [["fission.bfcacheInParent", true]]}, () => {
|
||||
// Have to open a new window, since there's no bfcache in subframes
|
||||
window.open("file_bug660404-1.html", "", "noopener");
|
||||
SimpleTest.enableLegacyUnpartitionedStorage().then(() => {
|
||||
var bc_multipart = new BroadcastChannel("bug660404_multipart");
|
||||
bc_multipart.onmessage = (msgEvent) => {
|
||||
var msg = msgEvent.data;
|
||||
var command = msg.command;
|
||||
if (command == "finishTest") {
|
||||
is(msg.textContent, textContent);
|
||||
is(msg.innerHTML, innerHTML);
|
||||
bc_multipart.close();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
var bc = new BroadcastChannel("bug660404");
|
||||
bc.onmessage = (msgEvent) => {
|
||||
var msg = msgEvent.data;
|
||||
var command = msg.command;
|
||||
if (command == "pagehide") {
|
||||
is(msg.persisted, true, "Should be bfcached when navigating to multipart");
|
||||
bc.close();
|
||||
}
|
||||
}
|
||||
// If Fission is disabled, the pref is no-op.
|
||||
SpecialPowers.pushPrefEnv({set: [["fission.bfcacheInParent", true]]}, () => {
|
||||
// Have to open a new window, since there's no bfcache in subframes
|
||||
window.open("file_bug660404-1.html", "", "noopener");
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user