Commit d0ba0483 authored by Nidhi Jaju's avatar Nidhi Jaju Committed by Commit Bot

Add StreamPipeOptions to Readable Streams

In an effort to change the blink implementation of readable
streams to better match the Web IDL descriptions in the Streams
API Standard, this CL adds the StreamPipeOptions dictionary [1]
to the ReadableStream class.

[1] https://streams.spec.whatwg.org/#dictdef-streampipeoptions

Bug: 1093862
Change-Id: Ic03fff0d645786dd48c4d8b7cd8682e0442bff0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2488329
Commit-Queue: Nidhi Jaju <nidhijaju@google.com>
Reviewed-by: default avatarAdam Rice <ricea@chromium.org>
Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821113}
parent c8e5de6d
...@@ -295,6 +295,8 @@ generated_dictionary_sources_in_core = [ ...@@ -295,6 +295,8 @@ generated_dictionary_sources_in_core = [
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_security_policy_violation_event_init.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_security_policy_violation_event_init.h",
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_shadow_root_init.cc", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_shadow_root_init.cc",
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_shadow_root_init.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_shadow_root_init.h",
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_stream_pipe_options.h",
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_stream_pipe_options.cc",
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_submit_event_init.cc", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_submit_event_init.cc",
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_submit_event_init.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_submit_event_init.h",
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_text_format_update_event_init.cc", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_text_format_update_event_init.cc",
......
...@@ -486,6 +486,7 @@ static_idl_files_in_core = get_path_info( ...@@ -486,6 +486,7 @@ static_idl_files_in_core = get_path_info(
"//third_party/blink/renderer/core/streams/readable_stream.idl", "//third_party/blink/renderer/core/streams/readable_stream.idl",
"//third_party/blink/renderer/core/streams/readable_stream_default_controller.idl", "//third_party/blink/renderer/core/streams/readable_stream_default_controller.idl",
"//third_party/blink/renderer/core/streams/readable_stream_default_reader.idl", "//third_party/blink/renderer/core/streams/readable_stream_default_reader.idl",
"//third_party/blink/renderer/core/streams/stream_pipe_options.idl",
"//third_party/blink/renderer/core/streams/transform_stream.idl", "//third_party/blink/renderer/core/streams/transform_stream.idl",
"//third_party/blink/renderer/core/streams/transform_stream_default_controller.idl", "//third_party/blink/renderer/core/streams/transform_stream_default_controller.idl",
"//third_party/blink/renderer/core/streams/underlying_sink_base.idl", "//third_party/blink/renderer/core/streams/underlying_sink_base.idl",
......
...@@ -736,6 +736,7 @@ core_dictionary_idl_files = ...@@ -736,6 +736,7 @@ core_dictionary_idl_files =
"mojo/test/mojo_interface_request_event_init.idl", "mojo/test/mojo_interface_request_event_init.idl",
"page/scrolling/scroll_state_init.idl", "page/scrolling/scroll_state_init.idl",
"resize_observer/resize_observer_options.idl", "resize_observer/resize_observer_options.idl",
"streams/stream_pipe_options.idl",
"streams/queuing_strategy_init.idl", "streams/queuing_strategy_init.idl",
"timing/measure_memory/measure_memory.idl", "timing/measure_memory/measure_memory.idl",
"timing/measure_memory/measure_memory_breakdown.idl", "timing/measure_memory/measure_memory_breakdown.idl",
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "third_party/blink/renderer/core/streams/readable_stream_default_controller.h" #include "third_party/blink/renderer/core/streams/readable_stream_default_controller.h"
#include "third_party/blink/renderer/core/streams/readable_stream_reader.h" #include "third_party/blink/renderer/core/streams/readable_stream_reader.h"
#include "third_party/blink/renderer/core/streams/stream_algorithms.h" #include "third_party/blink/renderer/core/streams/stream_algorithms.h"
#include "third_party/blink/renderer/core/streams/stream_pipe_options.h"
#include "third_party/blink/renderer/core/streams/stream_promise_resolver.h" #include "third_party/blink/renderer/core/streams/stream_promise_resolver.h"
#include "third_party/blink/renderer/core/streams/transferable_streams.h" #include "third_party/blink/renderer/core/streams/transferable_streams.h"
#include "third_party/blink/renderer/core/streams/underlying_source_base.h" #include "third_party/blink/renderer/core/streams/underlying_source_base.h"
...@@ -42,62 +43,14 @@ namespace blink { ...@@ -42,62 +43,14 @@ namespace blink {
ReadableStream::PipeOptions::PipeOptions() ReadableStream::PipeOptions::PipeOptions()
: prevent_close_(false), prevent_abort_(false), prevent_cancel_(false) {} : prevent_close_(false), prevent_abort_(false), prevent_cancel_(false) {}
ReadableStream::PipeOptions::PipeOptions(ScriptState* script_state, ReadableStream::PipeOptions::PipeOptions(const StreamPipeOptions* options)
ScriptValue options, : prevent_close_(options->hasPreventClose() ? options->preventClose()
ExceptionState& exception_state) { : false),
auto* isolate = script_state->GetIsolate(); prevent_abort_(options->hasPreventAbort() ? options->preventAbort()
v8::TryCatch block(isolate); : false),
v8::Local<v8::Value> options_value = options.V8Value(); prevent_cancel_(options->hasPreventCancel() ? options->preventCancel()
v8::Local<v8::Object> options_object; : false),
if (options_value->IsUndefined()) { signal_(options->hasSignal() ? options->signal() : nullptr) {}
options_object = v8::Object::New(isolate);
} else if (!options_value->ToObject(script_state->GetContext())
.ToLocal(&options_object)) {
exception_state.RethrowV8Exception(block.Exception());
return;
}
// 4. Set preventClose to ! ToBoolean(preventClose), set preventAbort to !
// ToBoolean(preventAbort), and set preventCancel to !
// ToBoolean(preventCancel).
prevent_close_ =
GetBoolean(script_state, options_object, "preventClose", exception_state);
if (exception_state.HadException()) {
return;
}
prevent_abort_ =
GetBoolean(script_state, options_object, "preventAbort", exception_state);
if (exception_state.HadException()) {
return;
}
prevent_cancel_ = GetBoolean(script_state, options_object, "preventCancel",
exception_state);
if (exception_state.HadException()) {
return;
}
v8::Local<v8::Value> signal_value;
if (!options_object
->Get(script_state->GetContext(), V8AtomicString(isolate, "signal"))
.ToLocal(&signal_value)) {
exception_state.RethrowV8Exception(block.Exception());
return;
}
// 5. If signal is not undefined, and signal is not an instance of the
// AbortSignal interface, throw a TypeError exception.
if (signal_value->IsUndefined())
return;
signal_ = V8AbortSignal::ToImplWithTypeCheck(isolate, signal_value);
if (!signal_) {
exception_state.ThrowTypeError(
"'signal' must be an AbortSignal object or undefined");
return;
}
}
void ReadableStream::PipeOptions::Trace(Visitor* visitor) const { void ReadableStream::PipeOptions::Trace(Visitor* visitor) const {
visitor->Trace(signal_); visitor->Trace(signal_);
...@@ -1280,15 +1233,13 @@ ScriptValue ReadableStream::pipeThrough(ScriptState* script_state, ...@@ -1280,15 +1233,13 @@ ScriptValue ReadableStream::pipeThrough(ScriptState* script_state,
ScriptValue transform_stream, ScriptValue transform_stream,
ExceptionState& exception_state) { ExceptionState& exception_state) {
return pipeThrough(script_state, transform_stream, return pipeThrough(script_state, transform_stream,
ScriptValue(script_state->GetIsolate(), StreamPipeOptions::Create(), exception_state);
v8::Undefined(script_state->GetIsolate())),
exception_state);
} }
// https://streams.spec.whatwg.org/#rs-pipe-through // https://streams.spec.whatwg.org/#rs-pipe-through
ScriptValue ReadableStream::pipeThrough(ScriptState* script_state, ScriptValue ReadableStream::pipeThrough(ScriptState* script_state,
ScriptValue transform_stream, ScriptValue transform_stream,
ScriptValue options, const StreamPipeOptions* options,
ExceptionState& exception_state) { ExceptionState& exception_state) {
// https://streams.spec.whatwg.org/#rs-pipe-through // https://streams.spec.whatwg.org/#rs-pipe-through
// The first part of this function implements the unpacking of the {readable, // The first part of this function implements the unpacking of the {readable,
...@@ -1341,58 +1292,48 @@ ScriptValue ReadableStream::pipeThrough(ScriptState* script_state, ...@@ -1341,58 +1292,48 @@ ScriptValue ReadableStream::pipeThrough(ScriptState* script_state,
return ScriptValue(); return ScriptValue();
} }
// 4. Set preventClose to ! ToBoolean(preventClose), set preventAbort to ! // 4. If signal is not undefined, and signal is not an instance of the
// ToBoolean(preventAbort), and set preventCancel to !
// ToBoolean(preventCancel).
// 5. If signal is not undefined, and signal is not an instance of the
// AbortSignal interface, throw a TypeError exception. // AbortSignal interface, throw a TypeError exception.
auto* pipe_options = auto* pipe_options = MakeGarbageCollected<PipeOptions>(options);
MakeGarbageCollected<PipeOptions>(script_state, options, exception_state);
if (exception_state.HadException()) {
return ScriptValue();
}
// 6. If ! IsReadableStreamLocked(*this*) is *true*, throw a *TypeError* // 5. If ! IsReadableStreamLocked(*this*) is *true*, throw a *TypeError*
// exception. // exception.
if (IsLocked(this)) { if (IsLocked(this)) {
exception_state.ThrowTypeError("Cannot pipe a locked stream"); exception_state.ThrowTypeError("Cannot pipe a locked stream");
return ScriptValue(); return ScriptValue();
} }
// 7. If ! IsWritableStreamLocked(_writable_) is *true*, throw a *TypeError* // 6. If ! IsWritableStreamLocked(_writable_) is *true*, throw a *TypeError*
// exception. // exception.
if (WritableStream::IsLocked(writable_stream)) { if (WritableStream::IsLocked(writable_stream)) {
exception_state.ThrowTypeError(kWritableIsLocked); exception_state.ThrowTypeError(kWritableIsLocked);
return ScriptValue(); return ScriptValue();
} }
// 8. Let _promise_ be ! ReadableStreamPipeTo(*this*, _writable_, // 7. Let _promise_ be ! ReadableStreamPipeTo(*this*, _writable_,
// _preventClose_, _preventAbort_, _preventCancel_, // _preventClose_, _preventAbort_, _preventCancel_,
// _signal_). // _signal_).
ScriptPromise promise = ScriptPromise promise =
PipeTo(script_state, this, writable_stream, pipe_options); PipeTo(script_state, this, writable_stream, pipe_options);
// 9. Set _promise_.[[PromiseIsHandled]] to *true*. // 8. Set _promise_.[[PromiseIsHandled]] to *true*.
promise.MarkAsHandled(); promise.MarkAsHandled();
// 10. Return _readable_. // 9. Return _readable_.
return ScriptValue(script_state->GetIsolate(), readable); return ScriptValue(script_state->GetIsolate(), readable);
} }
ScriptPromise ReadableStream::pipeTo(ScriptState* script_state, ScriptPromise ReadableStream::pipeTo(ScriptState* script_state,
ScriptValue destination, ScriptValue destination,
ExceptionState& exception_state) { ExceptionState& exception_state) {
return pipeTo(script_state, destination, return pipeTo(script_state, destination, StreamPipeOptions::Create(),
ScriptValue(script_state->GetIsolate(),
v8::Undefined(script_state->GetIsolate())),
exception_state); exception_state);
} }
ScriptPromise ReadableStream::pipeTo(ScriptState* script_state, ScriptPromise ReadableStream::pipeTo(ScriptState* script_state,
ScriptValue destination_value, ScriptValue destination_value,
ScriptValue options, const StreamPipeOptions* options,
ExceptionState& exception_state) { ExceptionState& exception_state) {
// https://streams.spec.whatwg.org/#rs-pipe-to // https://streams.spec.whatwg.org/#rs-pipe-to
// 2. If ! IsWritableStream(dest) is false, return a promise rejected with a // 2. If ! IsWritableStream(dest) is false, return a promise rejected with a
...@@ -1406,26 +1347,19 @@ ScriptPromise ReadableStream::pipeTo(ScriptState* script_state, ...@@ -1406,26 +1347,19 @@ ScriptPromise ReadableStream::pipeTo(ScriptState* script_state,
return ScriptPromise(); return ScriptPromise();
} }
// 3. Set preventClose to ! ToBoolean(preventClose), set preventAbort to ! // 3. If signal is not undefined, and signal is not an instance of the
// ToBoolean(preventAbort), and set preventCancel to !
// ToBoolean(preventCancel).
// 4. If signal is not undefined, and signal is not an instance of the
// AbortSignal interface, return a promise rejected with a TypeError // AbortSignal interface, return a promise rejected with a TypeError
// exception. // exception.
auto* pipe_options = auto* pipe_options = MakeGarbageCollected<PipeOptions>(options);
MakeGarbageCollected<PipeOptions>(script_state, options, exception_state);
if (exception_state.HadException()) {
return ScriptPromise();
}
// 5. If ! IsReadableStreamLocked(this) is true, return a promise rejected // 4. If ! IsReadableStreamLocked(this) is true, return a promise rejected
// with a TypeError exception. // with a TypeError exception.
if (IsLocked(this)) { if (IsLocked(this)) {
exception_state.ThrowTypeError("Cannot pipe a locked stream"); exception_state.ThrowTypeError("Cannot pipe a locked stream");
return ScriptPromise(); return ScriptPromise();
} }
// 6. If ! IsWritableStreamLocked(dest) is true, return a promise rejected // 5. If ! IsWritableStreamLocked(dest) is true, return a promise rejected
// with a TypeError exception. // with a TypeError exception.
if (WritableStream::IsLocked(destination)) { if (WritableStream::IsLocked(destination)) {
exception_state.ThrowTypeError("Cannot pipe to a locked stream"); exception_state.ThrowTypeError("Cannot pipe to a locked stream");
......
...@@ -25,6 +25,7 @@ class ScriptPromise; ...@@ -25,6 +25,7 @@ class ScriptPromise;
class ScriptState; class ScriptState;
class StrategySizeAlgorithm; class StrategySizeAlgorithm;
class StreamAlgorithm; class StreamAlgorithm;
class StreamPipeOptions;
class StreamPromiseResolver; class StreamPromiseResolver;
class StreamStartAlgorithm; class StreamStartAlgorithm;
class UnderlyingSourceBase; class UnderlyingSourceBase;
...@@ -40,9 +41,7 @@ class CORE_EXPORT ReadableStream : public ScriptWrappable { ...@@ -40,9 +41,7 @@ class CORE_EXPORT ReadableStream : public ScriptWrappable {
class PipeOptions : public GarbageCollected<PipeOptions> { class PipeOptions : public GarbageCollected<PipeOptions> {
public: public:
PipeOptions(); PipeOptions();
PipeOptions(ScriptState* script_state, explicit PipeOptions(const StreamPipeOptions* options);
ScriptValue options,
ExceptionState& exception_state);
bool PreventClose() const { return prevent_close_; } bool PreventClose() const { return prevent_close_; }
bool PreventAbort() const { return prevent_abort_; } bool PreventAbort() const { return prevent_abort_; }
...@@ -123,7 +122,7 @@ class CORE_EXPORT ReadableStream : public ScriptWrappable { ...@@ -123,7 +122,7 @@ class CORE_EXPORT ReadableStream : public ScriptWrappable {
// https://streams.spec.whatwg.org/#rs-pipe-through // https://streams.spec.whatwg.org/#rs-pipe-through
ScriptValue pipeThrough(ScriptState*, ScriptValue pipeThrough(ScriptState*,
ScriptValue transform_stream, ScriptValue transform_stream,
ScriptValue options, const StreamPipeOptions* options,
ExceptionState&); ExceptionState&);
ScriptPromise pipeTo(ScriptState*, ScriptValue destination, ExceptionState&); ScriptPromise pipeTo(ScriptState*, ScriptValue destination, ExceptionState&);
...@@ -131,7 +130,7 @@ class CORE_EXPORT ReadableStream : public ScriptWrappable { ...@@ -131,7 +130,7 @@ class CORE_EXPORT ReadableStream : public ScriptWrappable {
// https://streams.spec.whatwg.org/#rs-pipe-to // https://streams.spec.whatwg.org/#rs-pipe-to
ScriptPromise pipeTo(ScriptState*, ScriptPromise pipeTo(ScriptState*,
ScriptValue destination_value, ScriptValue destination_value,
ScriptValue options, const StreamPipeOptions* options,
ExceptionState&); ExceptionState&);
// https://streams.spec.whatwg.org/#rs-tee // https://streams.spec.whatwg.org/#rs-tee
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
[RaisesException, CallWith=ScriptState] Promise<any> cancel(optional any reason); [RaisesException, CallWith=ScriptState] Promise<any> cancel(optional any reason);
[RaisesException, CallWith=ScriptState, MeasureAs=ReadableStreamGetReader] ReadableStreamDefaultReader getReader(optional any mode); [RaisesException, CallWith=ScriptState, MeasureAs=ReadableStreamGetReader] ReadableStreamDefaultReader getReader(optional any mode);
[RaisesException, CallWith=ScriptState, MeasureAs=ReadableStreamPipeThrough] any pipeThrough( [RaisesException, CallWith=ScriptState, MeasureAs=ReadableStreamPipeThrough] any pipeThrough(
any transformStream, optional any options); any transformStream, optional StreamPipeOptions options);
[RaisesException, CallWith=ScriptState, MeasureAs=ReadableStreamPipeTo] Promise<any> pipeTo( [RaisesException, CallWith=ScriptState, MeasureAs=ReadableStreamPipeTo] Promise<any> pipeTo(
any destination, optional any option); any destination, optional StreamPipeOptions options);
[RaisesException, CallWith=ScriptState] any tee(); [RaisesException, CallWith=ScriptState] any tee();
}; };
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// https://streams.spec.whatwg.org/#dictdef-streampipeoptions
dictionary StreamPipeOptions {
boolean preventClose = false;
boolean preventAbort = false;
boolean preventCancel = false;
AbortSignal signal;
};
...@@ -198,3 +198,14 @@ promise_test(t => { ...@@ -198,3 +198,14 @@ promise_test(t => {
} }
}), 'pipeTo should reject'); }), 'pipeTo should reject');
}, 'pipeTo() should reject if an option getter grabs a writer'); }, 'pipeTo() should reject if an option getter grabs a writer');
promise_test(t => {
const rs = new ReadableStream({
start(controller) {
controller.close();
}
});
const ws = new WritableStream();
return rs.pipeTo(ws, null);
}, 'pipeTo() promise should resolve if null is passed');
This is a testharness.js-based test.
FAIL pipeTo should stop after getting preventAbort throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort"] length 1, got ["preventClose", "preventAbort"] length 2
FAIL pipeThrough should stop after getting preventAbort throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort"] length 1, got ["preventClose", "preventAbort"] length 2
FAIL pipeTo should stop after getting preventCancel throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort", "preventCancel"] length 2, got ["preventClose", "preventAbort", "preventCancel"] length 3
FAIL pipeThrough should stop after getting preventCancel throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort", "preventCancel"] length 2, got ["preventClose", "preventAbort", "preventCancel"] length 3
FAIL pipeTo should stop after getting preventClose throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort", "preventCancel", "preventClose"] length 3, got ["preventClose"] length 1
FAIL pipeThrough should stop after getting preventClose throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort", "preventCancel", "preventClose"] length 3, got ["preventClose"] length 1
FAIL pipeTo should stop after getting signal throws assert_array_equals: options should be touched in the right order expected property 0 to be "preventAbort" but got "preventClose" (expected array ["preventAbort", "preventCancel", "preventClose", "signal"] got ["preventClose", "preventAbort", "preventCancel", "signal"])
FAIL pipeThrough should stop after getting signal throws assert_array_equals: options should be touched in the right order expected property 0 to be "preventAbort" but got "preventClose" (expected array ["preventAbort", "preventCancel", "preventClose", "signal"] got ["preventClose", "preventAbort", "preventCancel", "signal"])
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL pipeTo should stop after getting preventAbort throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort"] length 1, got ["preventClose", "preventAbort"] length 2
FAIL pipeThrough should stop after getting preventAbort throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort"] length 1, got ["preventClose", "preventAbort"] length 2
FAIL pipeTo should stop after getting preventCancel throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort", "preventCancel"] length 2, got ["preventClose", "preventAbort", "preventCancel"] length 3
FAIL pipeThrough should stop after getting preventCancel throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort", "preventCancel"] length 2, got ["preventClose", "preventAbort", "preventCancel"] length 3
FAIL pipeTo should stop after getting preventClose throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort", "preventCancel", "preventClose"] length 3, got ["preventClose"] length 1
FAIL pipeThrough should stop after getting preventClose throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort", "preventCancel", "preventClose"] length 3, got ["preventClose"] length 1
FAIL pipeTo should stop after getting signal throws assert_array_equals: options should be touched in the right order expected property 0 to be "preventAbort" but got "preventClose" (expected array ["preventAbort", "preventCancel", "preventClose", "signal"] got ["preventClose", "preventAbort", "preventCancel", "signal"])
FAIL pipeThrough should stop after getting signal throws assert_array_equals: options should be touched in the right order expected property 0 to be "preventAbort" but got "preventClose" (expected array ["preventAbort", "preventCancel", "preventClose", "signal"] got ["preventClose", "preventAbort", "preventCancel", "signal"])
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL pipeTo should stop after getting preventAbort throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort"] length 1, got ["preventClose", "preventAbort"] length 2
FAIL pipeThrough should stop after getting preventAbort throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort"] length 1, got ["preventClose", "preventAbort"] length 2
FAIL pipeTo should stop after getting preventCancel throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort", "preventCancel"] length 2, got ["preventClose", "preventAbort", "preventCancel"] length 3
FAIL pipeThrough should stop after getting preventCancel throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort", "preventCancel"] length 2, got ["preventClose", "preventAbort", "preventCancel"] length 3
FAIL pipeTo should stop after getting preventClose throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort", "preventCancel", "preventClose"] length 3, got ["preventClose"] length 1
FAIL pipeThrough should stop after getting preventClose throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort", "preventCancel", "preventClose"] length 3, got ["preventClose"] length 1
FAIL pipeTo should stop after getting signal throws assert_array_equals: options should be touched in the right order expected property 0 to be "preventAbort" but got "preventClose" (expected array ["preventAbort", "preventCancel", "preventClose", "signal"] got ["preventClose", "preventAbort", "preventCancel", "signal"])
FAIL pipeThrough should stop after getting signal throws assert_array_equals: options should be touched in the right order expected property 0 to be "preventAbort" but got "preventClose" (expected array ["preventAbort", "preventCancel", "preventClose", "signal"] got ["preventClose", "preventAbort", "preventCancel", "signal"])
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL pipeTo should stop after getting preventAbort throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort"] length 1, got ["preventClose", "preventAbort"] length 2
FAIL pipeThrough should stop after getting preventAbort throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort"] length 1, got ["preventClose", "preventAbort"] length 2
FAIL pipeTo should stop after getting preventCancel throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort", "preventCancel"] length 2, got ["preventClose", "preventAbort", "preventCancel"] length 3
FAIL pipeThrough should stop after getting preventCancel throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort", "preventCancel"] length 2, got ["preventClose", "preventAbort", "preventCancel"] length 3
FAIL pipeTo should stop after getting preventClose throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort", "preventCancel", "preventClose"] length 3, got ["preventClose"] length 1
FAIL pipeThrough should stop after getting preventClose throws assert_array_equals: options should be touched in the right order lengths differ, expected array ["preventAbort", "preventCancel", "preventClose"] length 3, got ["preventClose"] length 1
FAIL pipeTo should stop after getting signal throws assert_array_equals: options should be touched in the right order expected property 0 to be "preventAbort" but got "preventClose" (expected array ["preventAbort", "preventCancel", "preventClose", "signal"] got ["preventClose", "preventAbort", "preventCancel", "signal"])
FAIL pipeThrough should stop after getting signal throws assert_array_equals: options should be touched in the right order expected property 0 to be "preventAbort" but got "preventClose" (expected array ["preventAbort", "preventCancel", "preventClose", "signal"] got ["preventClose", "preventAbort", "preventCancel", "signal"])
Harness: the test ran to completion.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment