Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise for the race-network-and-fetch-handler source without handler #50363

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>