no-speculative-fetch.tentative.optional.html (1180B)
1 <!DOCTYPE html> 2 <meta charset=utf-8> 3 <title>Speculative parsing, expect-no-linked-resources Document-Policy</title> 4 <meta name="timeout" content="long"> 5 <script src=/resources/testharness.js></script> 6 <script src=/resources/testharnessreport.js></script> 7 <script src="/resources/testdriver.js"></script> 8 <script src="/resources/testdriver-vendor.js"></script> 9 <script src="/common/utils.js"></script> 10 <script> 11 async function get_results(uuid) { 12 const response = await fetch(`/html/syntax/speculative-parsing/expect-no-linked-resources/resources/stash.py?action=get&uuid=${uuid}`); 13 return await response.text(); 14 } 15 16 promise_test(async () => { 17 const uuid = token(); 18 19 await test_driver.bless('Open a URL with expect-no-linked-resources Document-Policy'); 20 const popup = window.open(`/html/syntax/speculative-parsing/expect-no-linked-resources/resources/no-speculative-fetch.sub.html?pipe=sub&uuid=${uuid}`, '_blank'); 21 await new Promise(resolve => popup.addEventListener('load', resolve)); 22 23 const result = await get_results(uuid); 24 assert_equals(result, '', 'speculative case fetched'); 25 }, `expect-no-linked-resources hint was ignored`); 26 </script>