nonce.html (606B)
1 <!DOCTYPE html> 2 <html> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <meta http-equiv="Content-Security-Policy" content="script-src 'nonce-abc';"> 6 <script type="importmap" nonce="abc"> 7 { 8 "imports": { 9 "../resources/log.js?pipe=sub&name=A": "../resources/log.js?pipe=sub&name=B" 10 } 11 } 12 </script> 13 <script nonce="abc"> 14 const log = []; 15 promise_test(() => { 16 return import("../resources/log.js?pipe=sub&name=A") 17 .then(() => assert_array_equals(log, ["log:B"])) 18 }, 19 'Importmap should be accepted according to its correct nonce'); 20 </script>