Files
Frédéric Wang Nélar ffc23285a4 Bug 2056941 [wpt PR 61480] - Expose RequestDestination "compression-dictionary", a=testonly
Automatic update from web-platform-tests
Expose RequestDestination "compression-dictionary"

Currently, Chromium uses "dictionary" as an internal destination. Align
Chromium with spec PR [1], which uses string "compression-dictionary"
instead. This is a web-exposed behavior change, so do that under a
runtime flag.  Also add a WPT test to check the new value, a more
complex one is added in [2].

[1] https://github.com/whatwg/fetch/pull/1854
[2] https://chromium-review.googlesource.com/c/chromium/src/+/8129944

NO_IFTTT=Both files updated, but the IfThen labels were wrong.

Bug: 522338661, 40255884
Change-Id: I54b2047492ebc4d410351a83a10de8d0249b4b3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8086393
Reviewed-by: Patrick Meenan <pmeenan@chromium.org>
Commit-Queue: Frédéric Wang Nélar <fwang@igalia.com>
Reviewed-by: Andrea Orru <andreaorru@chromium.org>
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Benoit Lize <lizeb@chromium.org>
Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Reviewed-by: Ben Kelly <wanderview@meta.com>
Cr-Commit-Position: refs/heads/main@{#1666398}

--

wpt-commits: 69f36b0704aafee6a79156bfe842a491f482093e
wpt-pr: 61480
2026-07-24 05:44:28 +00:00

46 lines
1.6 KiB
HTML

<!DOCTYPE html>
<title>Fetch destination test for compression-dictionary</title>
<meta name="timeout" content="long"/>
<link rel="help" href="http://github.com/whatwg/html/pull/11620">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
<script>
let frame;
// Set up the service worker and the frame.
promise_test(t => {
const kScope = 'resources/empty.https.html';
const kScript = 'resources/fetch-options-worker.js';
return service_worker_unregister_and_register(t, kScript, kScope)
.then(registration => {
add_completion_callback(() => {
registration.unregister();
});
return wait_for_state(t, registration.installing, 'activated');
})
.then(() => {
return with_iframe(kScope);
})
.then(f => {
frame = f;
add_completion_callback(() => { f.remove(); });
});
}, 'Initialize global state');
promise_test(async t => {
await new Promise((resolve, reject) => {
let node = frame.contentWindow.document.createElement("link");
node.rel = "compression-dictionary";
node.onload = resolve;
node.onerror = reject;
node.href = "dummy?destination=compression-dictionary";
frame.contentWindow.document.body.appendChild(node);
}).catch(() => {
assert_unreached("Fetch errored.");
});
}, 'HTMLLinkElement with rel=compression-dictionary fetches with a "compression-dictionary" string Request.destination');
</script>