Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /import-maps/multiple-import-maps/basic.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
const log = [];
</script>
<script type="importmap" onerror="log.push('onerror 1')">
{
"imports": {
"../resources/log.js?pipe=sub&name=A1": "../resources/log.js?pipe=sub&name=B1",
"../resources/log.js?pipe=sub&name=A2": "../resources/log.js?pipe=sub&name=B2"
}
}
</script>
<script type="importmap" onerror="log.push('onerror 2')">
{
"imports": {
"../resources/log.js?pipe=sub&name=A1": "../resources/log.js?pipe=sub&name=C1",
"../resources/log.js?pipe=sub&name=A3": "../resources/log.js?pipe=sub&name=C3"
}
}
</script>
<script>
promise_test(() => {
return import("../resources/log.js?pipe=sub&name=A1")
.then(() => import("../resources/log.js?pipe=sub&name=A2"))
.then(() => import("../resources/log.js?pipe=sub&name=A3"))
.then(() => assert_array_equals(
log,
["log:B1", "log:B2", "log:C3"]))
},
"Second import map should be used for resolution");
</script>