Automatic update from web-platform-tests [compression-dictionary] Add WPT tests for load/error events on a <link rel=compression-dictionary> This is currently not specified but is proposed at https://github.com/whatwg/html/pull/11620 Bug: 522338661, 40255884 Change-Id: I9df45092e344588d4dc06cea0fc2fd4daf84caec Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8036725 Reviewed-by: Patrick Meenan <pmeenan@chromium.org> Commit-Queue: Frédéric Wang Nélar <fwang@igalia.com> Cr-Commit-Position: refs/heads/main@{#1660503} -- wpt-commits: 98fb56764b469c8b4bfa8dcd176e0da2df1ac283 wpt-pr: 61218
31 lines
1.3 KiB
HTML
31 lines
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="./resources/compression-dictionary-util.sub.js"></script>
|
|
<script>
|
|
compression_dictionary_promise_test(async t => {
|
|
const link = document.createElement('link');
|
|
t.add_cleanup(_ => link.remove());
|
|
link.rel = 'compression-dictionary';
|
|
link.href = kRegisterDictionaryPath;
|
|
link.addEventListener("error", t.unreached_func("error event should not be dispatched"));
|
|
return new Promise(resolve => {
|
|
link.addEventListener("load", resolve);
|
|
document.head.appendChild(link);
|
|
});
|
|
}, 'Load event is dispatched on link with rel=compression-dictionary.');
|
|
|
|
compression_dictionary_promise_test(async t => {
|
|
const link = document.createElement('link');
|
|
t.add_cleanup(_ => link.remove());
|
|
link.rel = 'compression-dictionary';
|
|
link.href = "./resources/register-dictionary-network-error.py";
|
|
link.addEventListener("load", t.unreached_func("load event should not be dispatched"));
|
|
return new Promise(resolve => {
|
|
link.addEventListener("error", resolve);
|
|
document.head.appendChild(link);
|
|
});
|
|
}, 'Error event is dispatched on link with rel=compression-dictionary returning a network error.');
|
|
</script>
|