| OLD | NEW |
| (Empty) |
| 1 'use strict'; | |
| 2 | |
| 3 if (self.importScripts) { | |
| 4 self.importScripts('/resources/testharness.js'); | |
| 5 } | |
| 6 | |
| 7 promise_test(() => { | |
| 8 let isDone = false; | |
| 9 const ws = new WritableStream( | |
| 10 { | |
| 11 write() { | |
| 12 return new Promise(resolve => { | |
| 13 setTimeout(() => { | |
| 14 isDone = true; | |
| 15 resolve(); | |
| 16 }, 200); | |
| 17 }); | |
| 18 }, | |
| 19 | |
| 20 close() { | |
| 21 assert_true(isDone, 'close is only called once the promise has been reso
lved'); | |
| 22 } | |
| 23 }, | |
| 24 new ByteLengthQueuingStrategy({ highWaterMark: 1024 * 16 }) | |
| 25 ); | |
| 26 | |
| 27 const writer = ws.getWriter(); | |
| 28 writer.write({ byteLength: 1024 }); | |
| 29 | |
| 30 return writer.close(); | |
| 31 }, 'Closing a writable stream with in-flight writes below the high water mark de
lays the close call properly'); | |
| 32 | |
| 33 done(); | |
| OLD | NEW |