blob: dfea6ea8717493e0a92c8f19b51e6c4f2b304edf [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<body>
<script>
const t = async_test('Makes sure that dynamically removed preloaded resource stop downloading');
const link = document.createElement("link");
link.as = "script";
link.rel = "preload";
link.href = "../resources/dummy.js";
const href = link.href;
document.body.appendChild(link);
link.href = "";
window.addEventListener("load", t.step_func_done(function() {
const entries = performance.getEntriesByName(href);
assert_equals(entries.length, 1);
// If fully downloaded, the transferSize would have been 281.
assert_less_than(entries[0].transferSize, 281);
}));
</script>
<script src="../resources/slow-script.pl?delay=200"></script>
</body>