| 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 const error1 = new Error('error1'); | 9 const error1 = new Error('error1'); |
| 10 error1.name = 'error1'; | 10 error1.name = 'error1'; |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 promise_test(t => { | 171 promise_test(t => { |
| 172 const ws = new WritableStream({ | 172 const ws = new WritableStream({ |
| 173 close() { | 173 close() { |
| 174 return new Promise(() => { }); // forever-pending | 174 return new Promise(() => { }); // forever-pending |
| 175 } | 175 } |
| 176 }); | 176 }); |
| 177 const writer = ws.getWriter(); | 177 const writer = ws.getWriter(); |
| 178 | 178 |
| 179 writer.close(); | 179 writer.close(); |
| 180 | 180 |
| 181 return delay(20).then(() => { | 181 return delay(0).then(() => { |
| 182 writer.abort(error1); | 182 writer.abort(error1); |
| 183 }) | 183 }) |
| 184 .then(() => promise_rejects(t, new TypeError(), writer.closed, 'closed should
reject with a TypeError')); | 184 .then(() => promise_rejects(t, new TypeError(), writer.closed, 'closed should
reject with a TypeError')); |
| 185 }, 'Closing a WritableStream and aborting it while it closes causes the stream t
o error'); | 185 }, 'Closing a WritableStream and aborting it while it closes causes the stream t
o error'); |
| 186 | 186 |
| 187 promise_test(() => { | 187 promise_test(() => { |
| 188 const ws = new WritableStream(); | 188 const ws = new WritableStream(); |
| 189 const writer = ws.getWriter(); | 189 const writer = ws.getWriter(); |
| 190 | 190 |
| 191 writer.close(); | 191 writer.close(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 214 onFulfilled(); | 214 onFulfilled(); |
| 215 } | 215 } |
| 216 }; | 216 }; |
| 217 } | 217 } |
| 218 }); | 218 }); |
| 219 const writer = ws.getWriter(); | 219 const writer = ws.getWriter(); |
| 220 return writer.abort().then(() => assert_true(thenCalled, 'then() should be cal
led')); | 220 return writer.abort().then(() => assert_true(thenCalled, 'then() should be cal
led')); |
| 221 }, 'returning a thenable from abort() should work'); | 221 }, 'returning a thenable from abort() should work'); |
| 222 | 222 |
| 223 done(); | 223 done(); |
| OLD | NEW |