presentation-request.html (637B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="utils.js"></script> 5 <script> 6 7 assert_true(document.prerendering); 8 9 async function startPresentationRequest() { 10 const bc = new PrerenderChannel('prerender-channel'); 11 const presentationRequest = new PresentationRequest( 12 'https://example.com/presentation.html'); 13 14 try { 15 const _ = await presentationRequest.start(); 16 bc.postMessage('unexpected success'); 17 } catch (err) { 18 bc.postMessage('request failed'); 19 } finally { 20 bc.close(); 21 } 22 } 23 24 startPresentationRequest(); 25 26 </script>