| OLD | NEW |
| 1 'use strict'; | 1 'use strict'; |
| 2 | 2 |
| 3 if (self.importScripts) { | 3 if (self.importScripts) { |
| 4 self.importScripts('../resources/test-utils.js'); | 4 self.importScripts('../resources/test-utils.js'); |
| 5 self.importScripts('../resources/rs-utils.js'); | 5 self.importScripts('../resources/rs-utils.js'); |
| 6 self.importScripts('/resources/testharness.js'); | 6 self.importScripts('/resources/testharness.js'); |
| 7 } | 7 } |
| 8 | 8 |
| 9 test(() => { | 9 test(() => { |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 'constructor should throw when the type is null'); | 30 'constructor should throw when the type is null'); |
| 31 assert_throws(new RangeError(), () => new ReadableStream({ type: '' }), | 31 assert_throws(new RangeError(), () => new ReadableStream({ type: '' }), |
| 32 'constructor should throw when the type is empty string'); | 32 'constructor should throw when the type is empty string'); |
| 33 assert_throws(new RangeError(), () => new ReadableStream({ type: 'asdf' }), | 33 assert_throws(new RangeError(), () => new ReadableStream({ type: 'asdf' }), |
| 34 'constructor should throw when the type is asdf'); | 34 'constructor should throw when the type is asdf'); |
| 35 | 35 |
| 36 }, 'ReadableStream can\'t be constructed with an invalid type'); | 36 }, 'ReadableStream can\'t be constructed with an invalid type'); |
| 37 | 37 |
| 38 test(() => { | 38 test(() => { |
| 39 | 39 |
| 40 const methods = ['cancel', 'constructor', 'getReader', 'tee']; | 40 const methods = ['cancel', 'constructor', 'getReader', 'pipeThrough', 'pipeTo'
, 'tee']; |
| 41 const properties = methods.concat(['locked']).sort(); | 41 const properties = methods.concat(['locked']).sort(); |
| 42 | 42 |
| 43 const rs = new ReadableStream(); | 43 const rs = new ReadableStream(); |
| 44 const proto = Object.getPrototypeOf(rs); | 44 const proto = Object.getPrototypeOf(rs); |
| 45 | 45 |
| 46 assert_array_equals(Object.getOwnPropertyNames(proto).sort(), properties, 'sho
uld have all the correct methods'); | 46 assert_array_equals(Object.getOwnPropertyNames(proto).sort(), properties, 'sho
uld have all the correct methods'); |
| 47 | 47 |
| 48 for (const m of methods) { | 48 for (const m of methods) { |
| 49 const propDesc = Object.getOwnPropertyDescriptor(proto, m); | 49 const propDesc = Object.getOwnPropertyDescriptor(proto, m); |
| 50 assert_false(propDesc.enumerable, 'method should be non-enumerable'); | 50 assert_false(propDesc.enumerable, 'method should be non-enumerable'); |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 const rs = sequentialReadableStream(10, { async: true }); | 844 const rs = sequentialReadableStream(10, { async: true }); |
| 845 | 845 |
| 846 return readableStreamToArray(rs).then(chunks => { | 846 return readableStreamToArray(rs).then(chunks => { |
| 847 assert_true(rs.source.closed, 'source should be closed after all chunks are
read'); | 847 assert_true(rs.source.closed, 'source should be closed after all chunks are
read'); |
| 848 assert_array_equals(chunks, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 'the expected 1
0 chunks should be read'); | 848 assert_array_equals(chunks, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 'the expected 1
0 chunks should be read'); |
| 849 }); | 849 }); |
| 850 | 850 |
| 851 }, 'ReadableStream integration test: adapting an async pull source'); | 851 }, 'ReadableStream integration test: adapting an async pull source'); |
| 852 | 852 |
| 853 done(); | 853 done(); |
| OLD | NEW |