| OLD | NEW |
| 1 'use strict'; | 1 'use strict'; |
| 2 | 2 |
| 3 if (self.importScripts) { | 3 if (self.importScripts) { |
| 4 self.importScripts('/resources/testharness.js'); | 4 self.importScripts('/resources/testharness.js'); |
| 5 self.importScripts('../resources/test-utils.js'); | 5 self.importScripts('../resources/test-utils.js'); |
| 6 self.importScripts('../resources/recording-streams.js'); | 6 self.importScripts('../resources/recording-streams.js'); |
| 7 } | 7 } |
| 8 | 8 |
| 9 test(() => { | 9 test(() => { |
| 10 | 10 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 154 |
| 155 }, 'Piping from a ReadableStream for which a chunk becomes asynchronously readab
le after the pipeTo'); | 155 }, 'Piping from a ReadableStream for which a chunk becomes asynchronously readab
le after the pipeTo'); |
| 156 | 156 |
| 157 for (const preventAbort of [true, false]) { | 157 for (const preventAbort of [true, false]) { |
| 158 promise_test(t => { | 158 promise_test(t => { |
| 159 | 159 |
| 160 const rs = new ReadableStream({ | 160 const rs = new ReadableStream({ |
| 161 pull() { | 161 pull() { |
| 162 return Promise.reject(undefined); | 162 return Promise.reject(undefined); |
| 163 } | 163 } |
| 164 }, { preventAbort }); | 164 }); |
| 165 | 165 |
| 166 return rs.pipeTo(new WritableStream()).then( | 166 return rs.pipeTo(new WritableStream(), { preventAbort }).then( |
| 167 () => assert_unreached('pipeTo promise should be rejected'), | 167 () => assert_unreached('pipeTo promise should be rejected'), |
| 168 value => assert_equals(value, undefined, 'rejection value should be unde
fined')); | 168 value => assert_equals(value, undefined, 'rejection value should be unde
fined')); |
| 169 | 169 |
| 170 }, `an undefined rejection from pull should cause pipeTo() to reject when prev
entAbort is ${preventAbort}`); | 170 }, `an undefined rejection from pull should cause pipeTo() to reject when prev
entAbort is ${preventAbort}`); |
| 171 } | 171 } |
| 172 | 172 |
| 173 for (const preventCancel of [true, false]) { | 173 for (const preventCancel of [true, false]) { |
| 174 promise_test(t => { | 174 promise_test(t => { |
| 175 | 175 |
| 176 const rs = new ReadableStream({ | 176 const rs = new ReadableStream({ |
| 177 pull(controller) { | 177 pull(controller) { |
| 178 controller.enqueue(0); | 178 controller.enqueue(0); |
| 179 } | 179 } |
| 180 }, { preventCancel }); | 180 }); |
| 181 | 181 |
| 182 const ws = new WritableStream({ | 182 const ws = new WritableStream({ |
| 183 write() { | 183 write() { |
| 184 return Promise.reject(undefined); | 184 return Promise.reject(undefined); |
| 185 } | 185 } |
| 186 }); | 186 }); |
| 187 | 187 |
| 188 return rs.pipeTo(ws).then( | 188 return rs.pipeTo(ws, { preventCancel }).then( |
| 189 () => assert_unreached('pipeTo promise should be rejected'), | 189 () => assert_unreached('pipeTo promise should be rejected'), |
| 190 value => assert_equals(value, undefined, 'rejection value should be unde
fined')); | 190 value => assert_equals(value, undefined, 'rejection value should be unde
fined')); |
| 191 | 191 |
| 192 }, `an undefined rejection from write should cause pipeTo() to reject when pre
ventCancel is ${preventCancel}`); | 192 }, `an undefined rejection from write should cause pipeTo() to reject when pre
ventCancel is ${preventCancel}`); |
| 193 } | 193 } |
| 194 | 194 |
| 195 done(); | 195 done(); |
| OLD | NEW |