Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(556)

Side by Side Diff: LayoutTests/http/tests/serviceworker/resources/fetch-event-async-respond-with-worker.js

Issue 723063002: Service Worker: Add a test for calling respondWith() asynchronously. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: actualyl upload Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 var result;
2
3 self.addEventListener('message', function(event) {
4 event.data.port.postMessage(result);
5 });
6
7 self.addEventListener('fetch', function(event) {
8 setTimeout(function() {
9 try {
10 event.respondWith(new Response());
11 result = 'FAIL: did not throw';
12 } catch (error) {
13 if (error.name == 'InvalidStateError')
14 result = 'PASS';
15 else
16 result = 'FAIL: Unexpected exception: ' + error;
17 }
18 }, 0);
19 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698