| 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');
|
|
|