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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/streams/readable-byte-streams/general.js

Issue 2665073003: Import wpt@cd5cce9780f84cee679919679b8199084ea96d54 (Closed)
Patch Set: Update test expectations and baselines. Created 3 years, 10 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'; 1 'use strict';
2 2
3 if (self.importScripts) { 3 if (self.importScripts) {
4 self.importScripts('../resources/rs-utils.js'); 4 self.importScripts('../resources/rs-utils.js');
5 self.importScripts('/resources/testharness.js'); 5 self.importScripts('/resources/testharness.js');
6 } 6 }
7 7
8 const error1 = new Error('error1'); 8 const error1 = new Error('error1');
9 error1.name = 'error1'; 9 error1.name = 'error1';
10 10
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 ++pullCount; 273 ++pullCount;
274 }, 274 },
275 type: 'bytes', 275 type: 'bytes',
276 autoAllocateChunkSize: 16 276 autoAllocateChunkSize: 16
277 }, { 277 }, {
278 highWaterMark: 0 278 highWaterMark: 0
279 }); 279 });
280 280
281 const reader = stream.getReader(); 281 const reader = stream.getReader();
282 const readPromise = reader.read(); 282 const readPromise = reader.read();
283 const ignoredReadPromise = reader.read();
283 284
284 assert_equals(pullCount, 0, 'No pull() as start() just finished and is not yet reflected to the state of the stream'); 285 assert_equals(pullCount, 0, 'No pull() as start() just finished and is not yet reflected to the state of the stream');
285 286
286 return Promise.resolve().then(() => { 287 return Promise.resolve().then(() => {
287 assert_equals(pullCount, 1, 'pull() must have been invoked once'); 288 assert_equals(pullCount, 1, 'pull() must have been invoked once');
288 return readPromise; 289 return readPromise;
289 }).then(result => { 290 }).then(result => {
290 assert_not_equals(result.value, undefined); 291 assert_not_equals(result.value, undefined);
291 assert_equals(result.value.constructor, Uint8Array); 292 assert_equals(result.value.constructor, Uint8Array);
292 assert_equals(result.value.buffer.byteLength, 16); 293 assert_equals(result.value.buffer.byteLength, 16);
(...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after
1911 assert_throws(new TypeError(), () => new ReadableStreamBYOBReader(stream), 'co nstructor must throw'); 1912 assert_throws(new TypeError(), () => new ReadableStreamBYOBReader(stream), 'co nstructor must throw');
1912 }, 'ReadableStreamBYOBReader constructor requires an unlocked ReadableStream'); 1913 }, 'ReadableStreamBYOBReader constructor requires an unlocked ReadableStream');
1913 1914
1914 test(() => { 1915 test(() => {
1915 const ReadableStreamBYOBReader = new ReadableStream({ type: 'bytes' }).getRead er({ mode: 'byob' }).constructor; 1916 const ReadableStreamBYOBReader = new ReadableStream({ type: 'bytes' }).getRead er({ mode: 'byob' }).constructor;
1916 const stream = new ReadableStream(); 1917 const stream = new ReadableStream();
1917 assert_throws(new TypeError(), () => new ReadableStreamBYOBReader(stream), 'co nstructor must throw'); 1918 assert_throws(new TypeError(), () => new ReadableStreamBYOBReader(stream), 'co nstructor must throw');
1918 }, 'ReadableStreamBYOBReader constructor requires a ReadableStream with type "by tes"'); 1919 }, 'ReadableStreamBYOBReader constructor requires a ReadableStream with type "by tes"');
1919 1920
1920 done(); 1921 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698