Skip to content

Commit

Permalink
Service Worker: Fetch event added asynchronously doesn't throw.
Browse files Browse the repository at this point in the history
Based on the spec (whatwg/dom#653),
addEventListener after the first evaluation of the Service
worker script should not throw.

Change-Id: I46af276a67e021cf277a98195bf5c04583ad0b0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1838376
Reviewed-by: Matt Falkenhagen <[email protected]>
Commit-Queue: Daniel Soromou <[email protected]>
Cr-Commit-Position: refs/heads/master@{#702753}
  • Loading branch information
caporalCoder authored and chromium-wpt-export-bot committed Oct 4, 2019
1 parent c5b1651 commit bc28ef5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions service-workers/service-worker/fetch-event-add-async.https.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<title>Service Worker: Fetch event added asynchronously doesn't throw</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/test-helpers.sub.js"></script>
<script>
'use strict';

service_worker_test(
'resources/fetch-event-add-async-worker.js');
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
importScripts('/resources/testharness.js');

promise_test(async () => {
await new Promise(handler => { step_timeout(handler, 0); });
self.addEventListener('fetch', () => {});
}, 'fetch event added asynchronously does not throw');

0 comments on commit bc28ef5

Please sign in to comment.