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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-event-respond-with-response-body-with-invalid-chunk-worker.js

Issue 2893793004: Upstream service wrkr "respond with" tests to WPT (Closed)
Patch Set: Remove declaration of unused binding Created 3 years, 7 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
1 'use strict';
2
1 self.addEventListener('fetch', event => { 3 self.addEventListener('fetch', event => {
2 if (!event.request.url.match(/body-stream-with-invalid-chunk$/)) 4 if (!event.request.url.match(/body-stream-with-invalid-chunk$/))
3 return; 5 return;
4 const stream = new ReadableStream({start: controller => { 6 const stream = new ReadableStream({start: controller => {
5 // The argument is intentionally a string, not a Uint8Array. 7 // The argument is intentionally a string, not a Uint8Array.
6 controller.enqueue('hello'); 8 controller.enqueue('hello');
7 }}); 9 }});
8 const headers = { 'x-content-type-options': 'nosniff' }; 10 const headers = { 'x-content-type-options': 'nosniff' };
9 event.respondWith(new Response(stream, { headers })); 11 event.respondWith(new Response(stream, { headers }));
10 }); 12 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698