blob: 09a9a466b511dd33b2bda6e67b459dccb3ee481a [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script id="target" type="module" src="resources/empty.js"></script>
<script>
var t = async_test('Makes sure that <script type="module"> preload resources');
target.onload = t.step_func(function() {
if (window.internals === undefined) {
throw new Error('This test requires internals.isPreloaded function.');
}
assert_true(internals.isPreloaded(target.src));
var absoluteUrl = new URL(target.src, location.href).href;
assert_equals(performance.getEntriesByName(absoluteUrl).length, 1,
'empty.js should load only once');
t.done();
});
</script>