import-maps-base-url.sub.html (1244B)
1 <!DOCTYPE html> 2 <meta name="timeout" content="long"> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="resources/test-helper.js"></script> 6 7 <script> 8 9 // baseURL will be used to create a <base> element, which will change the 10 // baseURL of the import map. 11 const baseURL = "http://{{host}}:{{ports[http][0]}}/import-maps/resources/"; 12 const importMap = ` 13 { 14 "imports": { 15 "bare/bare": "./log.js?pipe=sub&name=bare" 16 } 17 } 18 `; 19 20 promise_setup(function () { 21 return new Promise((resolve) => { 22 window.addEventListener("load", async () => { 23 await testStaticImport(importMap, baseURL, "bare/bare", "log:bare"); 24 await testDynamicImport(importMap, baseURL, "bare/bare", "log:bare", "module"); 25 await testDynamicImport(importMap, baseURL, "bare/bare", "log:bare", "text/javascript"); 26 27 await testStaticImportInjectBase(importMap, baseURL, "bare/bare", "log:bare"); 28 await testDynamicImportInjectBase(importMap, baseURL, "bare/bare", "log:bare", "module"); 29 await testDynamicImportInjectBase(importMap, baseURL, "bare/bare", "log:bare", "text/javascript"); 30 done(); 31 resolve(); 32 }); 33 }); 34 }, { explicit_done: true }); 35 36 37 </script> 38 <body>