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

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

Issue 1920703002: [Fetch API] Fix leaky layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/response.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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 promise_test(t => { 253 promise_test(t => {
254 var res = new Response(''); 254 var res = new Response('');
255 res.body.cancel(); 255 res.body.cancel();
256 return res.text().then(unreached_fulfillment(t), e => { 256 return res.text().then(unreached_fulfillment(t), e => {
257 assert_equals(e.name, 'TypeError'); 257 assert_equals(e.name, 'TypeError');
258 }); 258 });
259 }, 'Used => text'); 259 }, 'Used => text');
260 260
261 promise_test(t => { 261 promise_test(t => {
262 var res = new Response(''); 262 var res = new Response('');
263 res.body.getReader(); 263 const reader = res.body.getReader();
264 return res.arrayBuffer().then(unreached_fulfillment(t), e => { 264 return res.arrayBuffer().then(unreached_fulfillment(t), e => {
265 // TODO: yhirano Use finally when it's available. Ditto below.
Yuki 2016/04/25 06:57:10 typo: TODO(yhirano): ...
yhirano 2016/04/25 07:01:51 Done.
266 reader.releaseLock();
265 assert_equals(e.name, 'TypeError'); 267 assert_equals(e.name, 'TypeError');
266 }); 268 });
267 }, 'Locked => arrayBuffer'); 269 }, 'Locked => arrayBuffer');
268 270
269 promise_test(t => { 271 promise_test(t => {
270 var res = new Response(''); 272 var res = new Response('');
271 res.body.getReader(); 273 const reader = res.body.getReader();
272 return res.blob().then(unreached_fulfillment(t), e => { 274 return res.blob().then(unreached_fulfillment(t), e => {
275 reader.releaseLock();
273 assert_equals(e.name, 'TypeError'); 276 assert_equals(e.name, 'TypeError');
274 }); 277 });
275 }, 'Locked => blob'); 278 }, 'Locked => blob');
276 279
277 promise_test(t => { 280 promise_test(t => {
278 var res = new Response(''); 281 var res = new Response('');
279 res.body.getReader(); 282 const reader = res.body.getReader();
280 return res.json().then(unreached_fulfillment(t), e => { 283 return res.json().then(unreached_fulfillment(t), e => {
284 reader.releaseLock();
281 assert_equals(e.name, 'TypeError'); 285 assert_equals(e.name, 'TypeError');
282 }); 286 });
283 }, 'Locked => json'); 287 }, 'Locked => json');
284 288
285 promise_test(t => { 289 promise_test(t => {
286 var res = new Response(''); 290 var res = new Response('');
287 res.body.getReader(); 291 const reader = res.body.getReader();
288 return res.text().then(unreached_fulfillment(t), e => { 292 return res.text().then(unreached_fulfillment(t), e => {
293 reader.releaseLock();
289 assert_equals(e.name, 'TypeError'); 294 assert_equals(e.name, 'TypeError');
290 }); 295 });
291 }, 'Locked => text'); 296 }, 'Locked => text');
292 297
293 done(); 298 done();
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698