Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/utils.js"></script>
<script src="/common/dispatcher/dispatcher.js"></script>
<script src="/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js"></script>
<script src="../resources/utils.js"></script>
<script src="resources/utils.js"></script>
setup(() => assertSpeculationRulesIsSupported());
// We attempted to write this test using `RemoteContextHelper`. See
// However, that ended up being flaky in Chromium. See
// We're unsure yet if that flakiness was due to a test bug or an implementation
// bug. In case it is due to a test bug, we are currently trying the following
// uglier `PrerenderChannel` version. If it is still flaky, then probably it is
// an implementation bug, and we can revert to the prettier
// `RemoteContextHelper` version.
promise_test(async t => {
const uid = token();
const channel = new PrerenderChannel("result", uid);
const result = new Promise(r => channel.addEventListener("message", e => r(;
await result,
"document.prerendering in the inner page must be false"
}, "Prerendering inside a prerender doesn't work, and navigating inside prerenderingchange is fine");