sxg-subresource.tentative.html (848B)
1 <!DOCTYPE html> 2 <title>Subresource signed exchange prefetch.</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="/common/get-host-info.sub.js"></script> 6 <script src="../resources/sxg-util.js"></script> 7 <body> 8 <script> 9 promise_test(async (t) => { 10 const iframe_path = get_host_info().HTTPS_ORIGIN + '/signed-exchange/resources/sxg-subresource-iframe.html'; 11 const wait_message = (new Promise((resolve) => { 12 const on_message = (event) => { 13 window.removeEventListener('message', on_message); 14 resolve(event.data); 15 }; 16 window.addEventListener('message', on_message); 17 })); 18 withIframe(iframe_path); 19 const message = await wait_message; 20 assert_equals(message, 'from signed exchange'); 21 }, 'Subresource signed exchange prefetch.'); 22 </script> 23 </body>