1
0
Fork 0
firefox/testing/web-platform/tests/speculation-rules/prerender/resources/presentation-request.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

26 lines
637 B
HTML

<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="utils.js"></script>
<script>
assert_true(document.prerendering);
async function startPresentationRequest() {
const bc = new PrerenderChannel('prerender-channel');
const presentationRequest = new PresentationRequest(
'https://example.com/presentation.html');
try {
const _ = await presentationRequest.start();
bc.postMessage('unexpected success');
} catch (err) {
bc.postMessage('request failed');
} finally {
bc.close();
}
}
startPresentationRequest();
</script>