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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/body-mixin.js

Issue 2439673002: [Fetch API] Streaming error should be reported as a TypeError (Closed)
Patch Set: fix Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/stream-reader.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 if (self.importScripts) { 1 if (self.importScripts) {
2 importScripts('../resources/fetch-test-helpers.js'); 2 importScripts('../resources/fetch-test-helpers.js');
3 importScripts('/streams/resources/rs-utils.js'); 3 importScripts('/streams/resources/rs-utils.js');
4 } 4 }
5 5
6 function isLocked(stream) { 6 function isLocked(stream) {
7 try { 7 try {
8 var reader = stream.getReader(); 8 var reader = stream.getReader();
9 reader.releaseLock(); 9 reader.releaseLock();
10 return false; 10 return false;
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 288
289 promise_test(t => { 289 promise_test(t => {
290 var res = new Response(''); 290 var res = new Response('');
291 const reader = res.body.getReader(); 291 const reader = res.body.getReader();
292 return res.text().then(unreached_fulfillment(t), e => { 292 return res.text().then(unreached_fulfillment(t), e => {
293 reader.releaseLock(); 293 reader.releaseLock();
294 assert_equals(e.name, 'TypeError'); 294 assert_equals(e.name, 'TypeError');
295 }); 295 });
296 }, 'Locked => text'); 296 }, 'Locked => text');
297 297
298 promise_test(t => {
299 return fetch('/fetch/resources/slow-failure.cgi').then(response => {
300 return response.text().then(unreached_fulfillment(t), e => {
301 assert_equals(e.name, 'TypeError');
302 });
303 });
304 }, 'streaming error');
305
298 done(); 306 done();
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/stream-reader.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698