Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit de0e106

Browse files
Bug 1944496 [wpt PR 50363] - Raise for the race-network-and-fetch-handler 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
1 parent 4998c17 commit de0e106

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

testing/web-platform/tests/service-workers/service-worker/static-router-no-fetch-handler.https.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
const RULE_KEY_SOURCE_CACHE = 'condition-urlpattern-string-source-cache';
1616
const RULE_KEY_SOURCE_FETCH_EVENT =
1717
'condition-request-source-fetch-event';
18+
const RULE_KEY_SOURCE_RACE_NETWORK_AND_FETCH_HANDLER =
19+
'condition-urlpattern-string-source-race-network-and-fetch-handler';
1820
const SW_SRC = 'resources/static-router-no-fetch-handler-sw.js';
1921
const CACHED_FILE = 'cache.txt';
2022

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

49+
promise_test(async t => {
50+
const worker =
51+
await registerAndActivate(t,
52+
RULE_KEY_SOURCE_RACE_NETWORK_AND_FETCH_HANDLER, SW_SRC);
53+
t.add_cleanup(() => {reset_info_in_worker(worker)});
54+
55+
const {errors} = await get_info_from_worker(worker);
56+
assert_equals(errors.length, 1);
57+
}, 'addRoutes should raise if the race-network-and-fetch-handler source is used without onfetch')
58+
4759
</script>
4860
</body>

0 commit comments

Comments
 (0)