Skip to content

Commit

Permalink
Bug 1687401 [wpt PR 27236] - Streams: settle reader.[[closedPromise]]…
Browse files Browse the repository at this point in the history
… before performing close/error steps of read requests, a=testonly

Automatic update from web-platform-tests
Streams: settle reader.[[closedPromise]] before performing close/error steps of read requests

Follows whatwg/streams#1102.
--

wpt-commits: 7e94a4bcb5bd6808e08ed8db46fa63751543db52
wpt-pr: 27236

UltraBlame original commit: 20f8538ad6904319bdc6519519173023ebab1f2b
  • Loading branch information
marco-c committed Feb 16, 2021
1 parent b8cc28b commit 01170a6
Show file tree
Hide file tree
Showing 3 changed files with 464 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4530,3 +4530,208 @@ preventCancel
)
;
}
promise_test
(
async
(
)
=
>
{
const
rs
=
new
ReadableStream
(
{
async
start
(
c
)
{
c
.
enqueue
(
'
a
'
)
;
c
.
enqueue
(
'
b
'
)
;
c
.
enqueue
(
'
c
'
)
;
await
flushAsyncEvents
(
)
;
/
/
At
this
point
the
async
iterator
has
a
read
request
in
the
stream
'
s
queue
for
its
pending
next
(
)
promise
.
/
/
Closing
the
stream
now
causes
two
things
to
happen
*
synchronously
*
:
/
/
1
.
ReadableStreamClose
resolves
reader
.
[
[
closedPromise
]
]
with
undefined
.
/
/
2
.
ReadableStreamClose
calls
the
read
request
'
s
close
steps
which
calls
ReadableStreamReaderGenericRelease
/
/
which
replaces
reader
.
[
[
closedPromise
]
]
with
a
rejected
promise
.
c
.
close
(
)
;
}
}
)
;
const
chunks
=
[
]
;
for
await
(
const
chunk
of
rs
)
{
chunks
.
push
(
chunk
)
;
}
assert_array_equals
(
chunks
[
'
a
'
'
b
'
'
c
'
]
)
;
}
'
close
(
)
while
next
(
)
is
pending
'
)
;
Loading

0 comments on commit 01170a6

Please sign in to comment.