Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<meta charset="utf-8" />
<title>Resource Timing - initiatorUrl for module scripts requested by a statically loaded importer</title>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="../../resources/test-initiator.js"></script>
<!-- These importers are included so that they import module-script-imported.js. -->
<script type="module" src="/resource-timing/resources/module-script-importer-module-static.js"></script>
<script src="/resource-timing/resources/module-script-importer-classic.js"></script>
<script>
// A statically loaded importer is reported as the initiator for the target it
// imports, whether statically or dynamically (the classic importer can only
// import dynamically), distinguished by a label.
for (const {importer, label} of [
{importer: "module-script-importer-module-static.js",
label: "static-module-importer-static"},
{importer: "module-script-importer-module-static.js",
label: "static-module-importer-dynamic"},
{importer: "module-script-importer-module-static.js",
label: "static-module-importer-add-script"},
{importer: "module-script-importer-classic.js",
label: "classic-importer-dynamic"},
]) {
const resource = `module-script-imported.js?label=${label}`;
initiator_url_test(resource,
getUrl("/resource-timing/resources/" + importer),
`${label} initiatorUrl from ${importer}`,
`${label} timeout`);
}
</script>