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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/streams/writable-streams/byte-length-queuing-strategy.js

Issue 2772293002: Update WritableStream to new standard version (Closed)
Patch Set: Changes from domenic@ review Created 3 years, 8 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
(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();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698