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

Side by Side Diff: LayoutTests/http/tests/serviceworker/resources/fetch-worker.js

Issue 318393002: Initial implementation of ServiceWorkerGlobalScope.fetch() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update test files Created 6 years, 6 months 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
OLDNEW
(Empty)
1 self.onmessage = function(e) {
2 var message = e.data;
3 if ('port' in message) {
4 port = message.port;
5 doNextFetchTest(port);
6 }
7 };
8
9 var testTargets = [
10 'other.html',
11 'http://',
12 'http://www.example.com/foo'
13 ];
14
15 function doNextFetchTest(port) {
16 if (testTargets.length == 0) {
17 port.postMessage('quit');
18 return;
19 }
20 var target = testTargets.shift();
21 fetch(target)
22 .then(function() {
23 port.postMessage('Resolved: ' + target);
24 doNextFetchTest(port);
25 }).catch(function(e) {
26 port.postMessage('Rejected: ' + target + ' : '+ e.message);
27 doNextFetchTest(port);
28 })
29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698