mirror of
https://github.com/servo/servo.git
synced 2025-10-10 21:40:22 +01:00
31 lines
848 B
HTML
31 lines
848 B
HTML
<!DOCTYPE html>
|
|
<title>Same-origin prerendering cannot start presentation</title>
|
|
<meta name="timeout" content="long">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="resources/utils.js"></script>
|
|
<body>
|
|
<script>
|
|
|
|
setup(() => assertSpeculationRulesIsSupported());
|
|
|
|
promise_test(async t => {
|
|
const bc = new BroadcastChannel('prerender-channel');
|
|
|
|
const gotMessage = new Promise(resolve => {
|
|
bc.addEventListener('message', e => {
|
|
resolve(e.data);
|
|
}, {
|
|
once: true
|
|
});
|
|
});
|
|
|
|
// Start prerendering a page that attempts to start presentation.
|
|
startPrerendering(`resources/presentation-request.html`);
|
|
|
|
const result = await gotMessage;
|
|
assert_equals(result, 'request failed');
|
|
}, 'prerendering page cannot start presentation');
|
|
|
|
</script>
|
|
</body>
|