modulepreload.html (603B)
1 <!DOCTYPE html> 2 <html> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script> 6 const log = []; 7 </script> 8 <link rel="modulepreload" href="../resources/empty.js?pipe=trickle(d1)"></link> 9 <script type="importmap"> 10 { 11 "imports": { 12 "../resources/log.js?pipe=sub&name=A": "../resources/log.js?pipe=sub&name=B" 13 } 14 } 15 </script> 16 <script> 17 promise_test(() => { 18 return import("../resources/log.js?pipe=sub&name=A") 19 .then(() => assert_array_equals(log, ["log:B"])) 20 }, 21 'After <link rel=modulepreload> import maps should work fine'); 22 </script>