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

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

Issue 515323002: Revert of ServiceWorker: throw when close() or terminate() called (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
OLDNEW
1 self.onmessage = function(e) { 1 self.onmessage = function(e) {
2 var message = e.data; 2 var message = e.data;
3 if ('port' in message) { 3 if ('port' in message) {
4 port = message.port; 4 port = message.port;
5 doTextTest(port); 5 doTextTest(port);
6 } 6 }
7 }; 7 };
8 8
9 function quit(port) { 9 function quit(port) {
10 port.postMessage('quit'); 10 port.postMessage('quit');
11 self.close();
11 } 12 }
12 13
13 function doFetchTwiceTest(port) { 14 function doFetchTwiceTest(port) {
14 var p1Out = p2Out = null; 15 var p1Out = p2Out = null;
15 16
16 fetch('doctype.html') 17 fetch('doctype.html')
17 .then(function(response) { 18 .then(function(response) {
18 var p1 = response.body.asText(); 19 var p1 = response.body.asText();
19 var p2 = response.body.asText(); 20 var p2 = response.body.asText();
20 21
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 85
85 function doTextTest(port) { 86 function doTextTest(port) {
86 fetch('doctype.html') 87 fetch('doctype.html')
87 .then(function(response) { 88 .then(function(response) {
88 response.body.asText() 89 response.body.asText()
89 .then(function(txt) { 90 .then(function(txt) {
90 port.postMessage('Text: ' + txt); 91 port.postMessage('Text: ' + txt);
91 doJSONTest(port); 92 doJSONTest(port);
92 }); 93 });
93 }); 94 });
94 } 95 }
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/serviceworker/interfaces.html ('k') | LayoutTests/http/tests/serviceworker/resources/fetch-worker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698