avoid-delaying-onload-link-modulepreload-exec.html (807B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="/preload/resources/preload_helper.js"></script> 5 <link rel=modulepreload href="resources/slow-exec.js"> 6 <script> 7 setup(() => { 8 const link = window.document.createElement("link"); 9 assert_implements( 10 'relList' in link, 11 'HTMLLinkElement.relList is not supported'); 12 13 assert_implements( 14 link.relList.supports("modulepreload"), 15 'modulepreload is not supported'); 16 }); 17 18 promise_test(async t => { 19 await new Promise(r => window.addEventListener("load", r)); 20 21 assert_false(!!window.didLoadModule); 22 }, "Executing modulepreload should not block the window's load event"); 23 </script>