Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /import-maps/not-overridden/integrity.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
const log = [];
</script>
<script type="importmap">
{
"imports": {
"../resources/log.js?pipe=sub&name=A": "../resources/log.js?pipe=sub&name=B"
},
"integrity": {
"../resources/log.js?pipe=sub&name=B": "sha384-PeZ0Scqs60QjpuvHAyomddrpcCuox9hUwAff1yx1Lv2HtPIAfsSuHi6VKGK3nH3w"
}
}
</script>
<script type="importmap">
{
"integrity": {
"../resources/log.js?pipe=sub&name=B": "sha384-foobar"
}
}
</script>
<script type="module">
import '../resources/log.js?pipe=sub&name=A';
</script>
<script type="module">
test(t => {
assert_array_equals(log, ["log:B"]);
}, 'Static script loaded as its integrity check passed');
</script>
</body>
</html>