Automatic update from web-platform-tests [compression-dictionary] Check that invalid URLs neither trigger any load/error event nor any fetch request. "create a link request" for an invalid URL returns null per https://html.spec.whatwg.org/#create-a-link-request so "load a compression dictionary" should return early per https://github.com/whatwg/html/pull/11620 Bug: 522338661, 40255884 Change-Id: Id2f37d8c578a585200b88574ef1262048b98ded3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8084469 Reviewed-by: Patrick Meenan <pmeenan@chromium.org> Commit-Queue: Frédéric Wang Nélar <fwang@igalia.com> Cr-Commit-Position: refs/heads/main@{#1663433} -- wpt-commits: fe2e38df0b44dee73701b8fa7b4e3b56ccd8dced wpt-pr: 61348
32 lines
1.2 KiB
HTML
32 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<meta name="timeout" content="long"/>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script>
|
|
promise_test(async t => {
|
|
let fetchedEntries = [];
|
|
const observer = new PerformanceObserver((list) => {
|
|
list.getEntries().forEach(entry => {
|
|
// Ignore favicon.ico and testharness resources.
|
|
if (!entry.name.match(/testharness|favicon/g)) {
|
|
fetchedEntries.push(entry.name);
|
|
}
|
|
});
|
|
});
|
|
observer.observe({ type: "resource", buffered: true});
|
|
const link = document.createElement('link');
|
|
t.add_cleanup(_ => {
|
|
observer.disconnect();
|
|
link.remove();
|
|
});
|
|
link.rel = 'compression-dictionary';
|
|
link.href = "https://make:invalid/";
|
|
link.addEventListener("error", t.unreached_func("error event should not be dispatched"));
|
|
link.addEventListener("load", t.unreached_func("load event should not be dispatched"));
|
|
document.head.appendChild(link);
|
|
await new Promise(resolve => t.step_timeout(resolve, 1000));
|
|
assert_equals(fetchedEntries.length, 0);
|
|
}, 'link with rel=compression-dictionary and invalid href neither trigger any load/error event nor any fetch request.');
|
|
</script>
|