let outerBC = new BroadcastChannel("bug1740516_1");
let innerBC = new BroadcastChannel("bug1740516_1_inner");
let check = waitForPageShow(outerBC, innerBC).then(([first, second]) => {
is(first.name, "bug1740516_1_inner", "Should get pageShow from inner iframe page first.");
ok(!first.persisted, "First navigation shouldn't come from BFCache.");
is(second.name, "bug1740516_1", "Should get pageShow from outer page second.");
ok(!second.persisted, "First navigation shouldn't come from BFCache.");
}, () => {
ok(false, "The promises should not be rejected.");
});
window.open("file_bug1740516_1.html", "", "noopener");
await check;
check = waitForPageShow(outerBC, innerBC).then(([first, second]) => {
is(first.name, "bug1740516_1_inner", "Should get pageShow from inner iframe page first.");
ok(first.persisted, "Second navigation should come from BFCache");
is(second.name, "bug1740516_1", "Should get pageShow from outer page second.");
ok(second.persisted, "Second navigation should come from BFCache");
}, () => {
ok(false, "The promises should not be rejected.");
});
outerBC.postMessage("navigate");
await check;
check = waitForPageShow(outerBC, innerBC).then(([first, second]) => {
is(first.name, "bug1740516_1_inner", "Should get pageShow from inner iframe page first.");
ok(!first.persisted, "Third navigation should not come from BFCache");
is(second.name, "bug1740516_1", "Should get pageShow from outer page second.");
ok(!second.persisted, "Third navigation should not come from BFCache");
}, () => {
ok(false, "The promises should not be rejected.");
});
outerBC.postMessage("block_bfcache_and_navigate");
await check;