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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/streams/readable-streams/cancel.js

Issue 1902673003: Reflect recent spec changes to V8 Extra ReadableStream impl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed build Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/streams/readable-streams/cancel.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/streams/readable-streams/cancel.js b/third_party/WebKit/LayoutTests/http/tests/streams/readable-streams/cancel.js
index 310a7e8d1eb28de180ea1d8543e9a1c7772765af..3857c8e93414c703b041d9193f077b46470ed3ae 100644
--- a/third_party/WebKit/LayoutTests/http/tests/streams/readable-streams/cancel.js
+++ b/third_party/WebKit/LayoutTests/http/tests/streams/readable-streams/cancel.js
@@ -24,7 +24,6 @@ promise_test(() => {
cancel() {
randomSource.readStop();
- randomSource.onend();
return new Promise(resolve => {
setTimeout(() => {
@@ -39,14 +38,17 @@ promise_test(() => {
// We call delay multiple times to avoid cancelling too early for the
// source to enqueue at least one chunk.
- const cancel = delay(5).then(() => delay(5)).then(() => delay(5)).then(() => reader.cancel());
+ const cancel = delay(5).then(() => delay(5)).then(() => delay(5)).then(() => {
+ let cancelPromise = reader.cancel();
+ assert_false(cancellationFinished, 'cancellation in source should happen later');
+ return cancelPromise;
+ })
return readableStreamToArray(rs, reader).then(chunks => {
assert_greater_than(chunks.length, 0, 'at least one chunk should be read');
for (let i = 0; i < chunks.length; i++) {
assert_equals(chunks[i].length, 128, 'chunk ' + i + ' should have 128 bytes');
}
- assert_false(cancellationFinished, 'it did not wait for the cancellation process to finish before closing');
return cancel;
}).then(() => {
assert_true(cancellationFinished, 'it returns a promise that is fulfilled when the cancellation finishes');

Powered by Google App Engine
This is Rietveld 408576698