Skip to content

Commit

Permalink
Bug 1944496 [wpt PR 50363] - Raise for the race-network-and-fetch-han…
Browse files Browse the repository at this point in the history
…dler source without handler, a=testonly

Automatic update from web-platform-tests
Raise for the race-network-and-fetch-handler source without handler

This reflects the change in w3c/ServiceWorker#1719.
Instead of silently fallback to network, let me make `addRoutes()` raise
if the race-network-and-fetch-handler source is used without having a
fetch handler.

Fixed: 391990601
Change-Id: Ic944e183286cd056235b0fe272c543533dfaa86f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6211317
Reviewed-by: Takashi Toyoshima <[email protected]>
Commit-Queue: Yoshisato Yanagisawa <[email protected]>
Reviewed-by: Shunya Shishido <[email protected]>
Reviewed-by: Hidehiko Abe <[email protected]>
Reviewed-by: Keita Suzuki <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1412763}

--

wpt-commits: dcdc147a9ad20ccdef156d4444fbf526a2380235
wpt-pr: 50363
  • Loading branch information
yoshisatoyanagisawa authored and moz-wptsync-bot committed Jan 31, 2025
1 parent 4998c17 commit de0e106
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
const RULE_KEY_SOURCE_CACHE = 'condition-urlpattern-string-source-cache';
const RULE_KEY_SOURCE_FETCH_EVENT =
'condition-request-source-fetch-event';
const RULE_KEY_SOURCE_RACE_NETWORK_AND_FETCH_HANDLER =
'condition-urlpattern-string-source-race-network-and-fetch-handler';
const SW_SRC = 'resources/static-router-no-fetch-handler-sw.js';
const CACHED_FILE = 'cache.txt';

Expand Down Expand Up @@ -44,5 +46,15 @@
assert_equals(errors.length, 1);
}, 'addRoutes should raise if the fetch-event source is used without onfetch')

promise_test(async t => {
const worker =
await registerAndActivate(t,
RULE_KEY_SOURCE_RACE_NETWORK_AND_FETCH_HANDLER, SW_SRC);
t.add_cleanup(() => {reset_info_in_worker(worker)});

const {errors} = await get_info_from_worker(worker);
assert_equals(errors.length, 1);
}, 'addRoutes should raise if the race-network-and-fetch-handler source is used without onfetch')

</script>
</body>

0 comments on commit de0e106

Please sign in to comment.