diff --git a/dom/streams/ReadableStream.cpp b/dom/streams/ReadableStream.cpp index af14eb3035931..1e5192a67485a 100644 --- a/dom/streams/ReadableStream.cpp +++ b/dom/streams/ReadableStream.cpp @@ -31,7 +31,6 @@ #include "mozilla/dom/ReadableStreamController.h" #include "mozilla/dom/ReadableStreamDefaultController.h" #include "mozilla/dom/ReadableStreamDefaultReader.h" -#include "mozilla/dom/ReadableStreamPipeTo.h" #include "mozilla/dom/ReadableStreamTee.h" #include "mozilla/dom/RootedDictionary.h" #include "mozilla/dom/ScriptSettings.h" @@ -39,8 +38,6 @@ #include "mozilla/dom/TeeState.h" #include "mozilla/dom/UnderlyingSourceBinding.h" #include "mozilla/dom/UnderlyingSourceCallbackHelpers.h" -#include "mozilla/dom/WritableStream.h" -#include "mozilla/dom/WritableStreamDefaultWriter.h" #include "nsCOMPtr.h" #include "mozilla/dom/Promise-inl.h" @@ -849,37 +846,6 @@ static void ReadableStreamDefaultTee(JSContext* aCx, ReadableStream* aStream, aResult.AppendElement(teeState->Branch2()); } -// https://streams.spec.whatwg.org/#rs-pipe-to -already_AddRefed ReadableStream::PipeTo( - WritableStream& aDestination, const StreamPipeOptions& aOptions, - ErrorResult& aRv) { - // Step 1. If !IsReadableStreamLocked(this) is true, return a promise rejected - // with a TypeError exception. - if (IsReadableStreamLocked(this)) { - aRv.ThrowTypeError("Cannot pipe from a locked stream."); - return nullptr; - } - - // Step 2. If !IsWritableStreamLocked(destination) is true, return a promise - // rejected with a TypeError exception. - if (IsWritableStreamLocked(&aDestination)) { - aRv.ThrowTypeError("Can not pipe to a locked stream."); - return nullptr; - } - - // Step 3. Let signal be options["signal"] if it exists, or undefined - // otherwise. - RefPtr signal = - aOptions.mSignal.WasPassed() ? &aOptions.mSignal.Value() : nullptr; - - // Step 4. Return ! ReadableStreamPipeTo(this, destination, - // options["preventClose"], options["preventAbort"], options["preventCancel"], - // signal). - return ReadableStreamPipeTo(this, &aDestination, aOptions.mPreventClose, - aOptions.mPreventAbort, aOptions.mPreventCancel, - signal, aRv); -} - // https://streams.spec.whatwg.org/#readable-stream-tee MOZ_CAN_RUN_SCRIPT static void ReadableStreamTee(JSContext* aCx, ReadableStream* aStream, diff --git a/dom/streams/ReadableStream.h b/dom/streams/ReadableStream.h index 7519f88da34af..d61cbb285c886 100644 --- a/dom/streams/ReadableStream.h +++ b/dom/streams/ReadableStream.h @@ -14,7 +14,6 @@ #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/QueuingStrategyBinding.h" #include "mozilla/dom/ReadableStreamController.h" -#include "mozilla/dom/ReadableStreamBinding.h" #include "mozilla/dom/ReadableStreamDefaultController.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" @@ -32,7 +31,6 @@ class ReadableStreamDefaultReader; class ReadableStreamGenericReader; struct ReadableStreamGetReaderOptions; struct ReadIntoRequest; -class WritableStream; using ReadableStreamReader = ReadableStreamDefaultReaderOrReadableStreamBYOBReader; @@ -124,10 +122,6 @@ class ReadableStream final : public nsISupports, public nsWrapperCache { void GetReader(JSContext* aCx, const ReadableStreamGetReaderOptions& aOptions, OwningReadableStreamReader& resultReader, ErrorResult& aRv); - MOZ_CAN_RUN_SCRIPT already_AddRefed PipeTo( - WritableStream& aDestinaton, const StreamPipeOptions& aOptions, - ErrorResult& aRv); - MOZ_CAN_RUN_SCRIPT void Tee(JSContext* aCx, nsTArray>& aResult, ErrorResult& aRv); diff --git a/dom/streams/ReadableStreamPipeTo.cpp b/dom/streams/ReadableStreamPipeTo.cpp deleted file mode 100644 index eb4f14604b086..0000000000000 --- a/dom/streams/ReadableStreamPipeTo.cpp +++ /dev/null @@ -1,849 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "mozilla/dom/ReadableStream.h" -#include "mozilla/dom/ReadableStreamDefaultReader.h" -#include "mozilla/dom/ReadableStreamPipeTo.h" -#include "mozilla/dom/WritableStream.h" -#include "mozilla/dom/WritableStreamDefaultWriter.h" -#include "mozilla/dom/Promise.h" - -namespace mozilla::dom { - -// This is a helper class for PipeToPump that allows it to attach -// member functions as promise handlers. -class PipeToPumpHandler final : public PromiseNativeHandler { - virtual ~PipeToPumpHandler() = default; - - using FunPtr = void (PipeToPump::*)(JSContext*, JS::Handle); - - RefPtr mPipeToPump; - FunPtr mResolved; - FunPtr mRejected; - - public: - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_CLASS(PipeToPumpHandler) - - explicit PipeToPumpHandler(PipeToPump* aPipeToPump, FunPtr aResolved, - FunPtr aRejected) - : mPipeToPump(aPipeToPump), mResolved(aResolved), mRejected(aRejected) {} - - void ResolvedCallback(JSContext* aCx, JS::Handle aValue, - ErrorResult&) override { - if (mResolved) { - (mPipeToPump->*mResolved)(aCx, aValue); - } - } - - void RejectedCallback(JSContext* aCx, JS::Handle aReason, - ErrorResult&) override { - if (mRejected) { - (mPipeToPump->*mRejected)(aCx, aReason); - } - } -}; - -NS_IMPL_CYCLE_COLLECTION(PipeToPumpHandler, mPipeToPump) -NS_IMPL_CYCLE_COLLECTING_ADDREF(PipeToPumpHandler) -NS_IMPL_CYCLE_COLLECTING_RELEASE(PipeToPumpHandler) -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PipeToPumpHandler) - NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END - -void PipeToPump::RunAbortAlgorithm() { - AutoJSAPI jsapi; - if (!jsapi.Init(mReader->GetStream()->GetParentObject())) { - NS_WARNING( - "Failed to initialize AutoJSAPI in PipeToPump::RunAbortAlgorithm"); - return; - } - JSContext* cx = jsapi.cx(); - - RefPtr signal = Signal(); - PerformAbortAlgorithm(cx, signal); -} - -void PipeToPump::PerformAbortAlgorithm(JSContext* aCx, - AbortSignalImpl* aSignal) { - MOZ_ASSERT(aSignal->Aborted()); - - // https://streams.spec.whatwg.org/#readable-stream-pipe-to - // Step 14.1. Let abortAlgorithm be the following steps: - // Note: All the following steps are 14.1.xx - - // Step 1. Let error be signal’s abort reason. - JS::Rooted error(aCx); - aSignal->GetReason(aCx, &error); - - auto action = [](JSContext* aCx, PipeToPump* aPipeToPump, - JS::Handle> aError, - ErrorResult& aRv) - MOZ_CAN_RUN_SCRIPT -> already_AddRefed { - JS::Rooted error(aCx, *aError); - - // Step 2. Let actions be an empty ordered set. - nsTArray> actions; - - // Step 3. If preventAbort is false, append the following action to actions: - if (!aPipeToPump->mPreventAbort) { - RefPtr dest = aPipeToPump->mWriter->GetStream(); - - // Step 3.1. If dest.[[state]] is "writable", return ! - // WritableStreamAbort(dest, error). - if (dest->State() == WritableStream::WriterState::Writable) { - RefPtr p = WritableStreamAbort(aCx, dest, error, aRv); - if (aRv.Failed()) { - return nullptr; - } - actions.AppendElement(p); - } - - // Step 3.2. Otherwise, return a promise resolved with undefined. - // Note: This is basically a no-op. - } - - // Step 4. If preventCancel is false, append the following action action to - // actions: - if (!aPipeToPump->mPreventCancel) { - RefPtr source = aPipeToPump->mReader->GetStream(); - - // Step 4.1. If source.[[state]] is "readable", return ! - // ReadableStreamCancel(source, error). - if (source->State() == ReadableStream::ReaderState::Readable) { - RefPtr p = ReadableStreamCancel(aCx, source, error, aRv); - if (aRv.Failed()) { - return nullptr; - } - actions.AppendElement(p); - } - - // Step 4.2. Otherwise, return a promise resolved with undefined. - // No-op again. - } - - // Step 5. .. action consisting of getting a promise to wait for - // all of the actions in actions ... - return Promise::All(aCx, actions, aRv); - }; - - // Step 5. Shutdown with an action consisting of getting a promise to wait for - // all of the actions in actions, and with error. - JS::Rooted> someError(aCx, Some(error.get())); - ShutdownWithAction(aCx, action, someError); -} - -bool PipeToPump::SourceOrDestErroredOrClosed(JSContext* aCx) { - // (Constraint) Error and close states must be propagated: - // the following conditions must be applied in order. - RefPtr source = mReader->GetStream(); - RefPtr dest = mWriter->GetStream(); - - // Step 1. Errors must be propagated forward: if source.[[state]] is or - // becomes "errored", then - if (source->State() == ReadableStream::ReaderState::Errored) { - JS::Rooted storedError(aCx, source->StoredError()); - OnSourceErrored(aCx, storedError); - return true; - } - - // Step 2. Errors must be propagated backward: if dest.[[state]] is or becomes - // "errored", then - if (dest->State() == WritableStream::WriterState::Errored) { - JS::Rooted storedError(aCx, dest->StoredError()); - OnDestErrored(aCx, storedError); - return true; - } - - // Step 3. Closing must be propagated forward: if source.[[state]] is or - // becomes "closed", then - if (source->State() == ReadableStream::ReaderState::Closed) { - OnSourceClosed(aCx, JS::UndefinedHandleValue); - return true; - } - - // Step 4. Closing must be propagated backward: - // if ! WritableStreamCloseQueuedOrInFlight(dest) is true - // or dest.[[state]] is "closed", then - if (dest->CloseQueuedOrInFlight() || - dest->State() == WritableStream::WriterState::Closed) { - OnDestClosed(aCx, JS::UndefinedHandleValue); - return true; - } - - return false; -} - -// https://streams.spec.whatwg.org/#readable-stream-pipe-to -// Steps 14-15. -void PipeToPump::Start(JSContext* aCx, AbortSignal* aSignal) { - // Step 14. If signal is not undefined, - if (aSignal) { - // Step 14.1. Let abortAlgorithm be the following steps: - // ... This is implemented by RunAbortAlgorithm. - - // Step 14.2. If signal is aborted, perform abortAlgorithm and - // return promise. - if (aSignal->Aborted()) { - PerformAbortAlgorithm(aCx, aSignal); - return; - } - - // Step 14.3. Add abortAlgorithm to signal. - Follow(aSignal); - } - - // Step 15. In parallel but not really; see #905, using reader and writer, - // read all chunks from source and write them to dest. - // Due to the locking provided by the reader and writer, - // the exact manner in which this happens is not observable to author code, - // and so there is flexibility in how this is done. - - // (Constraint) Error and close states must be propagated - - // Before piping has started, we have to check for source/destination being - // errored/closed manually. - if (SourceOrDestErroredOrClosed(aCx)) { - return; - } - - // We use the following two promises to propagate error and close states - // during piping. - RefPtr readerClosed = mReader->ClosedPromise(); - readerClosed->AppendNativeHandler(new PipeToPumpHandler( - this, &PipeToPump::OnSourceClosed, &PipeToPump::OnSourceErrored)); - - // Note: Because we control the destination/writer it should never be closed - // after we did the initial check above with SourceOrDestErroredOrClosed. - RefPtr writerClosed = mWriter->ClosedPromise(); - writerClosed->AppendNativeHandler(new PipeToPumpHandler( - this, &PipeToPump::OnDestClosed, &PipeToPump::OnDestErrored)); - - Read(aCx); -} - -class WriteFinishedPromiseHandler final : public PromiseNativeHandler { - RefPtr mPipeToPump; - PipeToPump::ShutdownAction mAction; - bool mHasError; - JS::Heap mError; - - virtual ~WriteFinishedPromiseHandler() { mozilla::DropJSObjects(this); }; - - public: - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(WriteFinishedPromiseHandler) - - explicit WriteFinishedPromiseHandler( - JSContext* aCx, PipeToPump* aPipeToPump, - PipeToPump::ShutdownAction aAction, - JS::Handle> aError) - : mPipeToPump(aPipeToPump), mAction(aAction) { - mHasError = aError.isSome(); - if (mHasError) { - mError = *aError; - } - mozilla::HoldJSObjects(this); - } - - MOZ_CAN_RUN_SCRIPT void WriteFinished(JSContext* aCx) { - RefPtr pipeToPump = mPipeToPump; // XXX known-live? - JS::Rooted> error(aCx); - if (mHasError) { - error = Some(mError); - } - pipeToPump->ShutdownWithActionAfterFinishedWrite(aCx, mAction, error); - } - - MOZ_CAN_RUN_SCRIPT void ResolvedCallback(JSContext* aCx, - JS::Handle aValue, - ErrorResult&) override { - WriteFinished(aCx); - } - - MOZ_CAN_RUN_SCRIPT void RejectedCallback(JSContext* aCx, - JS::Handle aReason, - ErrorResult&) override { - WriteFinished(aCx); - } -}; - -NS_IMPL_CYCLE_COLLECTION(WriteFinishedPromiseHandler, mPipeToPump) -NS_IMPL_CYCLE_COLLECTING_ADDREF(WriteFinishedPromiseHandler) -NS_IMPL_CYCLE_COLLECTING_RELEASE(WriteFinishedPromiseHandler) -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(WriteFinishedPromiseHandler) - NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END -NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(WriteFinishedPromiseHandler) - NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mError) -NS_IMPL_CYCLE_COLLECTION_TRACE_END - -// https://streams.spec.whatwg.org/#rs-pipeTo-shutdown-with-action -// Shutdown with an action: if any of the above requirements ask to shutdown -// with an action action, optionally with an error originalError, then: -void PipeToPump::ShutdownWithAction( - JSContext* aCx, ShutdownAction aAction, - JS::Handle> aError) { - // Step 1. If shuttingDown is true, abort these substeps. - if (mShuttingDown) { - return; - } - - // Step 2. Set shuttingDown to true. - mShuttingDown = true; - - // Step 3. If dest.[[state]] is "writable" and ! - // WritableStreamCloseQueuedOrInFlight(dest) is false, - RefPtr dest = mWriter->GetStream(); - if (dest->State() == WritableStream::WriterState::Writable && - !dest->CloseQueuedOrInFlight()) { - // Step 3.1. If any chunks have been read but not yet written, write them to - // dest. - // Step 3.2. Wait until every chunk that has been read has been - // written (i.e. the corresponding promises have settled). - // - // Note: Write requests are processed in order, so when the promise - // for the last written chunk is settled all previous chunks have been - // written as well. - if (mLastWritePromise) { - mLastWritePromise->AppendNativeHandler( - new WriteFinishedPromiseHandler(aCx, this, aAction, aError)); - return; - } - } - - // Don't have to wait for last write, immediately continue. - ShutdownWithActionAfterFinishedWrite(aCx, aAction, aError); -} - -class ShutdownActionFinishedPromiseHandler final : public PromiseNativeHandler { - RefPtr mPipeToPump; - bool mHasError; - JS::Heap mError; - - virtual ~ShutdownActionFinishedPromiseHandler() { - mozilla::DropJSObjects(this); - } - - public: - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS( - ShutdownActionFinishedPromiseHandler) - - explicit ShutdownActionFinishedPromiseHandler( - JSContext* aCx, PipeToPump* aPipeToPump, - JS::Handle> aError) - : mPipeToPump(aPipeToPump) { - mHasError = aError.isSome(); - if (mHasError) { - mError = *aError; - } - mozilla::HoldJSObjects(this); - } - - void ResolvedCallback(JSContext* aCx, JS::Handle aValue, - ErrorResult&) override { - // https://streams.spec.whatwg.org/#rs-pipeTo-shutdown-with-action - // Step 5. Upon fulfillment of p, finalize, passing along originalError if - // it was given. - JS::Rooted> error(aCx); - if (mHasError) { - error = Some(mError); - } - mPipeToPump->Finalize(aCx, error); - } - - void RejectedCallback(JSContext* aCx, JS::Handle aReason, - ErrorResult&) override { - // https://streams.spec.whatwg.org/#rs-pipeTo-shutdown-with-action - // Step 6. Upon rejection of p with reason newError, finalize with - // newError. - JS::Rooted> error(aCx, Some(aReason)); - mPipeToPump->Finalize(aCx, error); - } -}; - -NS_IMPL_CYCLE_COLLECTION(ShutdownActionFinishedPromiseHandler, mPipeToPump) -NS_IMPL_CYCLE_COLLECTING_ADDREF(ShutdownActionFinishedPromiseHandler) -NS_IMPL_CYCLE_COLLECTING_RELEASE(ShutdownActionFinishedPromiseHandler) -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ShutdownActionFinishedPromiseHandler) - NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END -NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(ShutdownActionFinishedPromiseHandler) - NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mError) -NS_IMPL_CYCLE_COLLECTION_TRACE_END - -// https://streams.spec.whatwg.org/#rs-pipeTo-shutdown-with-action -// Continuation after Step 3. triggered a promise resolution. -void PipeToPump::ShutdownWithActionAfterFinishedWrite( - JSContext* aCx, ShutdownAction aAction, - JS::Handle> aError) { - if (!aAction) { - // Used to implement shutdown without action. Finalize immediately. - Finalize(aCx, aError); - return; - } - - // Step 4. Let p be the result of performing action. - RefPtr thisRefPtr = this; - ErrorResult rv; - RefPtr p = aAction(aCx, thisRefPtr, aError, rv); - - // Error while calling actions above, continue immediately with finalization. - rv.WouldReportJSException(); - if (rv.Failed()) { - JS::Rooted error(aCx); - bool ok = ToJSValue(aCx, std::move(rv), &error); - MOZ_RELEASE_ASSERT(ok, "must be ok"); - JS::Rooted> someError(aCx, Some(error.get())); - Finalize(aCx, someError); - return; - } - - // Steps 5-6. - p->AppendNativeHandler( - new ShutdownActionFinishedPromiseHandler(aCx, this, aError)); -} - -// https://streams.spec.whatwg.org/#rs-pipeTo-shutdown -// Shutdown: if any of the above requirements or steps ask to shutdown, -// optionally with an error error, then: -void PipeToPump::Shutdown(JSContext* aCx, - JS::Handle> aError) { - // Note: We implement "shutdown" in terms of "shutdown with action". - // We can observe that when passing along an action that always succeeds - // shutdown with action and shutdown have the same behavior, when - // Ignoring the potential micro task for the promise that we skip anyway. - ShutdownWithAction(aCx, nullptr, aError); -} - -// https://streams.spec.whatwg.org/#rs-pipeTo-finalize -// Finalize: both forms of shutdown will eventually ask to finalize, -// optionally with an error error, which means to perform the following steps: -void PipeToPump::Finalize(JSContext* aCx, - JS::Handle> aError) { - IgnoredErrorResult rv; - // Step 1. Perform ! WritableStreamDefaultWriterRelease(writer). - WritableStreamDefaultWriterRelease(aCx, mWriter, rv); - NS_WARNING_ASSERTION(!rv.Failed(), - "WritableStreamDefaultWriterRelease should not fail."); - - // Step 2. If reader implements ReadableStreamBYOBReader, - // perform ! ReadableStreamBYOBReaderRelease(reader). - // Note: We always use a default reader. - MOZ_ASSERT(!mReader->IsBYOB()); - - // Step 3. Otherwise, perform ! ReadableStreamDefaultReaderRelease(reader). - ReadableStreamDefaultReaderRelease(aCx, mReader, rv); - NS_WARNING_ASSERTION(!rv.Failed(), - "ReadableStreamReaderGenericRelease should not fail."); - - // Step 3. If signal is not undefined, remove abortAlgorithm from signal. - if (IsFollowing()) { - Unfollow(); - } - - // Step 4. If error was given, reject promise with error. - if (aError.isSome()) { - JS::Rooted error(aCx, *aError); - mPromise->MaybeReject(error); - } else { - // Step 5. Otherwise, resolve promise with undefined. - mPromise->MaybeResolveWithUndefined(); - } - - // Remove all references. - mPromise = nullptr; - mReader = nullptr; - mWriter = nullptr; - mLastWritePromise = nullptr; - Unfollow(); -} - -void PipeToPump::OnReadFulfilled(JSContext* aCx, JS::Handle aChunk, - ErrorResult& aRv) { - // (Constraint) Shutdown must stop activity: - // if shuttingDown becomes true, the user agent must not initiate further - // reads from reader, and must only perform writes of already-read chunks ... - // - // We may reach this point after |On{Source,Dest}{Clos,Error}ed| has responded - // to an out-of-band change. Per the comment in |OnSourceErrored|, we want to - // allow the implicated shutdown to proceed, and we don't want to interfere - // with or additionally alter its operation. Particularly, we don't want to - // queue up the successfully-read chunk (if there was one, and this isn't just - // reporting "done") to be written: it wasn't "already-read" when that - // error/closure happened. - // - // All specified reactions to a closure/error invoke either the shutdown, or - // shutdown with an action, algorithms. Those algorithms each abort if either - // shutdown algorithm has already been invoked. So we check for shutdown here - // in case of asynchronous closure/error and abort if shutdown has already - // started (and possibly finished). - // - // TODO: Implement the eventual resolution from - // https://github.com/whatwg/streams/issues/1207 - if (mShuttingDown) { - return; - } - - mLastWritePromise = WritableStreamDefaultWriterWrite( - aCx, MOZ_KnownLive(mWriter), aChunk, aRv); - if (aRv.Failed()) { - mLastWritePromise = nullptr; - return; - } - - mLastWritePromise->AppendNativeHandler( - new PipeToPumpHandler(this, nullptr, &PipeToPump::OnDestErrored)); - - // Last read has finished, so it's time to start reading again. - Read(aCx); -} - -void PipeToPump::OnWriterReady(JSContext* aCx, JS::Handle) { - // Writer is ready again (i.e. backpressure was resolved), so read. - Read(aCx); -} - -struct PipeToReadRequest : public ReadRequest { - public: - NS_DECL_ISUPPORTS_INHERITED - NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(PipeToReadRequest, ReadRequest) - - RefPtr mPipeToPump; - - explicit PipeToReadRequest(PipeToPump* aPipeToPump) - : mPipeToPump(aPipeToPump) {} - - MOZ_CAN_RUN_SCRIPT_BOUNDARY void ChunkSteps(JSContext* aCx, - JS::Handle aChunk, - ErrorResult& aRv) override { - RefPtr pipeToPump = mPipeToPump; // XXX known live? - pipeToPump->OnReadFulfilled(aCx, aChunk, aRv); - } - - // The reader's closed promise handlers will already call OnSourceClosed/ - // OnSourceErrored, so these steps can just be ignored. - void CloseSteps(JSContext* aCx, ErrorResult& aRv) override {} - void ErrorSteps(JSContext* aCx, JS::Handle aError, - ErrorResult& aRv) override {} - - protected: - virtual ~PipeToReadRequest() = default; -}; - -NS_IMPL_CYCLE_COLLECTION_CLASS(PipeToReadRequest) - -NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(PipeToReadRequest, ReadRequest) - NS_IMPL_CYCLE_COLLECTION_UNLINK(mPipeToPump) -NS_IMPL_CYCLE_COLLECTION_UNLINK_END - -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(PipeToReadRequest, - ReadRequest) - NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPipeToPump) -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END - -NS_IMPL_ADDREF_INHERITED(PipeToReadRequest, ReadRequest) -NS_IMPL_RELEASE_INHERITED(PipeToReadRequest, ReadRequest) - -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PipeToReadRequest) -NS_INTERFACE_MAP_END_INHERITING(ReadRequest) - -void PipeToPump::Read(JSContext* aCx) { -#ifdef DEBUG - mReadChunk = true; -#endif - - // (Constraint) Shutdown must stop activity: - // If shuttingDown becomes true, the user agent must not initiate - // further reads from reader - if (mShuttingDown) { - return; - } - - // (Constraint) Backpressure must be enforced: - // While WritableStreamDefaultWriterGetDesiredSize(writer) is ≤ 0 or is null, - // the user agent must not read from reader. - Nullable desiredSize = - WritableStreamDefaultWriterGetDesiredSize(mWriter); - if (desiredSize.IsNull()) { - // This means the writer has errored. This is going to be handled - // by the writer closed promise. - return; - } - - if (desiredSize.Value() <= 0) { - // Wait for the writer to become ready before reading more data from - // the reader. We don't care about rejections here, because those are - // already handled by the writer closed promise. - RefPtr readyPromise = mWriter->Ready(); - readyPromise->AppendNativeHandler( - new PipeToPumpHandler(this, &PipeToPump::OnWriterReady, nullptr)); - return; - } - - RefPtr request = new PipeToReadRequest(this); - ErrorResult rv; - ReadableStreamDefaultReaderRead(aCx, MOZ_KnownLive(mReader), request, rv); - rv.WouldReportJSException(); - if (rv.Failed()) { - // XXX It's actually not quite obvious what we should do here. - // We've got an error during reading, so on the surface it seems logical - // to invoke `OnSourceErrored`. However in certain cases the required - // condition > source.[[state]] is or becomes "errored" < won't actually - // happen i.e. when `WritableStreamDefaultWriterWrite` called from - // `OnReadFulfilled` (via PipeToReadRequest::ChunkSteps) fails in - // a synchronous fashion. - JS::Rooted error(aCx); - bool ok = ToJSValue(aCx, std::move(rv), &error); - MOZ_RELEASE_ASSERT(ok, "must be ok"); - JS::Rooted> someError(aCx, Some(error.get())); - Shutdown(aCx, someError); - } -} - -// Step 3. Closing must be propagated forward: if source.[[state]] is or -// becomes "closed", then -void PipeToPump::OnSourceClosed(JSContext* aCx, JS::Handle) { - // Step 3.1. If preventClose is false, shutdown with an action of - // ! WritableStreamDefaultWriterCloseWithErrorPropagation(writer). - if (!mPreventClose) { - ShutdownWithAction( - aCx, - [](JSContext* aCx, PipeToPump* aPipeToPump, - JS::Handle> aError, ErrorResult& aRv) - MOZ_CAN_RUN_SCRIPT -> already_AddRefed { - RefPtr writer = aPipeToPump->mWriter; - return WritableStreamDefaultWriterCloseWithErrorPropagation( - aCx, writer, aRv); - }, - JS::NothingHandleValue); - } else { - // Step 3.2 Otherwise, shutdown. - Shutdown(aCx, JS::NothingHandleValue); - } -} - -// Step 1. Errors must be propagated forward: if source.[[state]] is or -// becomes "errored", then -void PipeToPump::OnSourceErrored(JSContext* aCx, - JS::Handle aSourceStoredError) { - // If |source| becomes errored not during a pending read, it's clear we must - // react immediately. - // - // But what if |source| becomes errored *during* a pending read? Should this - // first error, or the pending-read second error, predominate? Two semantics - // are possible when |source|/|dest| become closed or errored while there's a - // pending read: - // - // 1. Wait until the read fulfills or rejects, then respond to the - // closure/error without regard to the read having fulfilled or rejected. - // (This will simply not react to the read being rejected, or it will - // queue up the read chunk to be written during shutdown.) - // 2. React to the closure/error immediately per "Error and close states - // must be propagated". Then when the read fulfills or rejects later, do - // nothing. - // - // The spec doesn't clearly require either semantics. It requires that - // *already-read* chunks be written (at least if |dest| didn't become errored - // or closed such that no further writes can occur). But it's silent as to - // not-fully-read chunks. (These semantic differences may only be observable - // with very carefully constructed readable/writable streams.) - // - // It seems best, generally, to react to the temporally-earliest problem that - // arises, so we implement option #2. (Blink, in contrast, currently - // implements option #1.) - // - // All specified reactions to a closure/error invoke either the shutdown, or - // shutdown with an action, algorithms. Those algorithms each abort if either - // shutdown algorithm has already been invoked. So we don't need to do - // anything special here to deal with a pending read. - // - // TODO: Implement the eventual resolution from - // https://github.com/whatwg/streams/issues/1207 - - // Step 1.1 If preventAbort is false, shutdown with an action of - // ! WritableStreamAbort(dest, source.[[storedError]]) - // and with source.[[storedError]]. - JS::Rooted> error(aCx, Some(aSourceStoredError)); - if (!mPreventAbort) { - ShutdownWithAction( - aCx, - [](JSContext* aCx, PipeToPump* aPipeToPump, - JS::Handle> aError, ErrorResult& aRv) - MOZ_CAN_RUN_SCRIPT -> already_AddRefed { - JS::Rooted error(aCx, *aError); - RefPtr dest = aPipeToPump->mWriter->GetStream(); - return WritableStreamAbort(aCx, dest, error, aRv); - }, - error); - } else { - // Step 1.1. Otherwise, shutdown with source.[[storedError]]. - Shutdown(aCx, error); - } -} - -// Step 4. Closing must be propagated backward: -// if ! WritableStreamCloseQueuedOrInFlight(dest) is true -// or dest.[[state]] is "closed", then -void PipeToPump::OnDestClosed(JSContext* aCx, JS::Handle) { - // Step 4.1. Assert: no chunks have been read or written. - // Note: No reading automatically implies no writing. - // In a perfect world OnDestClosed would only be called before we start - // piping, because afterwards the writer has an exclusive lock on the stream. - // In reality the closed promise can still be resolved after we release - // the lock on the writer in Finalize. - if (mShuttingDown) { - return; - } - MOZ_ASSERT(!mReadChunk); - - // Step 4.2. Let destClosed be a new TypeError. - JS::Rooted> destClosed(aCx, Nothing()); - { - ErrorResult rv; - rv.ThrowTypeError("Cannot pipe to closed stream"); - JS::Rooted error(aCx); - bool ok = ToJSValue(aCx, std::move(rv), &error); - MOZ_RELEASE_ASSERT(ok, "must be ok"); - destClosed = Some(error.get()); - } - - // Step 4.3. If preventCancel is false, shutdown with an action of - // ! ReadableStreamCancel(source, destClosed) and with destClosed. - if (!mPreventCancel) { - ShutdownWithAction( - aCx, - [](JSContext* aCx, PipeToPump* aPipeToPump, - JS::Handle> aError, ErrorResult& aRv) - MOZ_CAN_RUN_SCRIPT -> already_AddRefed { - JS::Rooted error(aCx, *aError); - RefPtr dest = aPipeToPump->mReader->GetStream(); - return ReadableStreamCancel(aCx, dest, error, aRv); - }, - destClosed); - } else { - // Step 4.4. Otherwise, shutdown with destClosed. - Shutdown(aCx, destClosed); - } -} - -// Step 2. Errors must be propagated backward: if dest.[[state]] is or becomes -// "errored", then -void PipeToPump::OnDestErrored(JSContext* aCx, - JS::Handle aDestStoredError) { - // Step 2.1. If preventCancel is false, shutdown with an action of - // ! ReadableStreamCancel(source, dest.[[storedError]]) - // and with dest.[[storedError]]. - JS::Rooted> error(aCx, Some(aDestStoredError)); - if (!mPreventCancel) { - ShutdownWithAction( - aCx, - [](JSContext* aCx, PipeToPump* aPipeToPump, - JS::Handle> aError, ErrorResult& aRv) - MOZ_CAN_RUN_SCRIPT -> already_AddRefed { - JS::Rooted error(aCx, *aError); - RefPtr dest = aPipeToPump->mReader->GetStream(); - return ReadableStreamCancel(aCx, dest, error, aRv); - }, - error); - } else { - // Step 2.1. Otherwise, shutdown with dest.[[storedError]]. - Shutdown(aCx, error); - } -} - -NS_IMPL_CYCLE_COLLECTION_CLASS(PipeToPump) -NS_IMPL_CYCLE_COLLECTING_ADDREF(PipeToPump) -NS_IMPL_CYCLE_COLLECTING_RELEASE(PipeToPump) -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PipeToPump) - NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END - -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(PipeToPump) - NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPromise) - NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mReader) - NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWriter) - NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLastWritePromise) -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END - -NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(PipeToPump) - NS_IMPL_CYCLE_COLLECTION_UNLINK(mPromise) - NS_IMPL_CYCLE_COLLECTION_UNLINK(mReader) - NS_IMPL_CYCLE_COLLECTION_UNLINK(mWriter) - NS_IMPL_CYCLE_COLLECTION_UNLINK(mLastWritePromise) -NS_IMPL_CYCLE_COLLECTION_UNLINK_END - -// https://streams.spec.whatwg.org/#readable-stream-pipe-to -already_AddRefed ReadableStreamPipeTo( - ReadableStream* aSource, WritableStream* aDest, bool aPreventClose, - bool aPreventAbort, bool aPreventCancel, AbortSignal* aSignal, - mozilla::ErrorResult& aRv) { - // Step 1. Assert: source implements ReadableStream. (Implicit) - // Step 2. Assert: dest implements WritableStream. (Implicit) - // Step 3. Assert: preventClose, preventAbort, and preventCancel are all - // booleans (Implicit) - // Step 4. If signal was not given, let signal be - // undefined. (Implicit) - // Step 5. Assert: either signal is undefined, or signal - // implements AbortSignal. (Implicit) - // Step 6. Assert: !IsReadableStreamLocked(source) is false. - MOZ_ASSERT(!IsReadableStreamLocked(aSource)); - - // Step 7. Assert: !IsWritableStreamLocked(dest) is false. - MOZ_ASSERT(!IsWritableStreamLocked(aDest)); - - AutoJSAPI jsapi; - if (!jsapi.Init(aSource->GetParentObject())) { - aRv.ThrowUnknownError("Internal error"); - return nullptr; - } - JSContext* cx = jsapi.cx(); - - // Step 8. If source.[[controller]] implements ReadableByteStreamController, - // let reader be either !AcquireReadableStreamBYOBReader(source) or - // !AcquireReadableStreamDefaultReader(source), at the user agent’s - // discretion. - // Step 9. Otherwise, let reader be - // !AcquireReadableStreamDefaultReader(source). - - // Note: In the interests of simplicity, we choose here to always acquire - // a default reader. - RefPtr reader = - AcquireReadableStreamDefaultReader(cx, aSource, aRv); - if (aRv.Failed()) { - return nullptr; - } - - // Step 10. Let writer be ! AcquireWritableStreamDefaultWriter(dest). - RefPtr writer = - AcquireWritableStreamDefaultWriter(aDest, aRv); - if (aRv.Failed()) { - return nullptr; - } - - // Step 11. Set source.[[disturbed]] to true. - aSource->SetDisturbed(true); - - // Step 12. Let shuttingDown be false. - // Note: PipeToPump ensures this by construction. - - // Step 13. Let promise be a new promise. - RefPtr promise = Promise::Create(aSource->GetParentObject(), aRv); - if (aRv.Failed()) { - return nullptr; - } - - // Steps 14-15. - RefPtr pump = new PipeToPump( - promise, reader, writer, aPreventClose, aPreventAbort, aPreventCancel); - pump->Start(cx, aSignal); - - // Step 16. Return promise. - return promise.forget(); -} - -} // namespace mozilla::dom diff --git a/dom/streams/ReadableStreamPipeTo.h b/dom/streams/ReadableStreamPipeTo.h deleted file mode 100644 index be6fa46caa958..0000000000000 --- a/dom/streams/ReadableStreamPipeTo.h +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef mozilla_dom_ReadableStreamPipeTo_h -#define mozilla_dom_ReadableStreamPipeTo_h - -#include "mozilla/ErrorResult.h" -#include "mozilla/dom/AbortFollower.h" -#include "nsCycleCollectionParticipant.h" -#include "nsISupportsImpl.h" - -namespace mozilla::dom { - -struct PipeToReadRequest; -class WriteFinishedPromiseHandler; -class ShutdownActionFinishedPromiseHandler; - -class ReadableStreamDefaultReader; -class WritableStreamDefaultWriter; - -// https://streams.spec.whatwg.org/#readable-stream-pipe-to (Steps 14-15.) -// -// This class implements everything that is required to read all chunks from -// the reader (source) and write them to writer (destination), while -// following the constraints given in the spec using our implementation-defined -// behavior. -// -// The cycle-collected references look roughly like this: -// clang-format off -// -// Closed promise <-- ReadableStreamDefaultReader <--> ReadableStream -// | ^ | -// |(PromiseHandler) |(mReader) |(ReadRequest) -// | | | -// |-------------> PipeToPump <------- -// ^ | | -// |---------------| | | -// | | |-------(mLastWrite) --------> -// |(PromiseHandler) | |< ---- (PromiseHandler) ---- Promise -// | | ^ -// | |(mWriter) |(mWriteRequests) -// | v | -// Closed promise <-- WritableStreamDefaultWriter <--------> WritableStream -// -// clang-format on -class PipeToPump final : public AbortFollower { - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_CLASS(PipeToPump) - - friend struct PipeToReadRequest; - friend class WriteFinishedPromiseHandler; - friend class ShutdownActionFinishedPromiseHandler; - - PipeToPump(Promise* aPromise, ReadableStreamDefaultReader* aReader, - WritableStreamDefaultWriter* aWriter, bool aPreventClose, - bool aPreventAbort, bool aPreventCancel) - : mPromise(aPromise), - mReader(aReader), - mWriter(aWriter), - mPreventClose(aPreventClose), - mPreventAbort(aPreventAbort), - mPreventCancel(aPreventCancel) {} - - MOZ_CAN_RUN_SCRIPT void Start(JSContext* aCx, AbortSignal* aSignal); - - MOZ_CAN_RUN_SCRIPT_BOUNDARY void RunAbortAlgorithm() override; - - private: - virtual ~PipeToPump() = default; - - MOZ_CAN_RUN_SCRIPT void PerformAbortAlgorithm(JSContext* aCx, - AbortSignalImpl* aSignal); - - MOZ_CAN_RUN_SCRIPT bool SourceOrDestErroredOrClosed(JSContext* aCx); - - using ShutdownAction = already_AddRefed (*)( - JSContext*, PipeToPump*, JS::Handle>, - ErrorResult&); - - MOZ_CAN_RUN_SCRIPT void ShutdownWithAction( - JSContext* aCx, ShutdownAction aAction, - JS::Handle> aError); - MOZ_CAN_RUN_SCRIPT void ShutdownWithActionAfterFinishedWrite( - JSContext* aCx, ShutdownAction aAction, - JS::Handle> aError); - - MOZ_CAN_RUN_SCRIPT void Shutdown( - JSContext* aCx, JS::Handle> aError); - - void Finalize(JSContext* aCx, JS::Handle> aError); - - MOZ_CAN_RUN_SCRIPT void OnReadFulfilled(JSContext* aCx, - JS::Handle aChunk, - ErrorResult& aRv); - MOZ_CAN_RUN_SCRIPT void OnWriterReady(JSContext* aCx, JS::Handle); - MOZ_CAN_RUN_SCRIPT void Read(JSContext* aCx); - - MOZ_CAN_RUN_SCRIPT void OnSourceClosed(JSContext* aCx, JS::Handle); - MOZ_CAN_RUN_SCRIPT void OnSourceErrored(JSContext* aCx, - JS::Handle aError); - - MOZ_CAN_RUN_SCRIPT void OnDestClosed(JSContext* aCx, JS::Handle); - MOZ_CAN_RUN_SCRIPT void OnDestErrored(JSContext* aCx, - JS::Handle aError); - - RefPtr mPromise; - RefPtr mReader; - RefPtr mWriter; - RefPtr mLastWritePromise; - const bool mPreventClose; - const bool mPreventAbort; - const bool mPreventCancel; - bool mShuttingDown = false; -#ifdef DEBUG - bool mReadChunk = false; -#endif -}; - -MOZ_CAN_RUN_SCRIPT already_AddRefed ReadableStreamPipeTo( - ReadableStream* aSource, WritableStream* aDest, bool aPreventClose, - bool aPreventAbort, bool aPreventCancel, AbortSignal* aSignal, - ErrorResult& aRv); - -} // namespace mozilla::dom - -#endif // mozilla_dom_ReadableStreamPipeTo_h diff --git a/dom/streams/WritableStream.h b/dom/streams/WritableStream.h index 2f3051f5a9828..46a9e676091a6 100644 --- a/dom/streams/WritableStream.h +++ b/dom/streams/WritableStream.h @@ -194,9 +194,6 @@ MOZ_CAN_RUN_SCRIPT extern already_AddRefed WritableStreamClose( extern already_AddRefed WritableStreamAddWriteRequest( WritableStream* aStream, ErrorResult& aRv); -extern already_AddRefed -AcquireWritableStreamDefaultWriter(WritableStream* aStream, ErrorResult& aRv); - } // namespace mozilla::dom #endif // mozilla_dom_WritableStream_h diff --git a/dom/streams/WritableStreamDefaultWriter.cpp b/dom/streams/WritableStreamDefaultWriter.cpp index be57f070cb455..825d9263cf39b 100644 --- a/dom/streams/WritableStreamDefaultWriter.cpp +++ b/dom/streams/WritableStreamDefaultWriter.cpp @@ -98,8 +98,8 @@ already_AddRefed WritableStreamDefaultWriter::Ready() { } // https://streams.spec.whatwg.org/#writable-stream-default-writer-get-desired-size -Nullable WritableStreamDefaultWriterGetDesiredSize( - WritableStreamDefaultWriter* aWriter) { +static Nullable WritableStreamDefaultWriterGetDesiredSize( + WritableStreamDefaultWriter* aWriter, ErrorResult& aRv) { // Step 1. Let stream be writer.[[stream]]. RefPtr stream = aWriter->GetStream(); @@ -132,7 +132,7 @@ Nullable WritableStreamDefaultWriter::GetDesiredSize(ErrorResult& aRv) { // Step 2. Return ! WritableStreamDefaultWriterGetDesiredSize(this). RefPtr thisRefPtr = this; - return WritableStreamDefaultWriterGetDesiredSize(thisRefPtr); + return WritableStreamDefaultWriterGetDesiredSize(thisRefPtr, aRv); } // https://streams.spec.whatwg.org/#writable-stream-default-writer-abort @@ -271,9 +271,11 @@ void WritableStreamDefaultWriter::ReleaseLock(JSContext* aCx, } // https://streams.spec.whatwg.org/#writable-stream-default-writer-write -already_AddRefed WritableStreamDefaultWriterWrite( - JSContext* aCx, WritableStreamDefaultWriter* aWriter, - JS::Handle aChunk, ErrorResult& aRv) { +MOZ_CAN_RUN_SCRIPT static already_AddRefed +WritableStreamDefaultWriterWrite(JSContext* aCx, + WritableStreamDefaultWriter* aWriter, + JS::Handle aChunk, + ErrorResult& aRv) { // Step 1. Let stream be writer.[[stream]]. RefPtr stream = aWriter->GetStream(); @@ -547,44 +549,4 @@ void WritableStreamDefaultWriterEnsureReadyPromiseRejected( readyPromise->SetSettledPromiseIsHandled(); } -// https://streams.spec.whatwg.org/#writable-stream-default-writer-close-with-error-propagation -already_AddRefed WritableStreamDefaultWriterCloseWithErrorPropagation( - JSContext* aCx, WritableStreamDefaultWriter* aWriter, ErrorResult& aRv) { - // Step 1. Let stream be writer.[[stream]]. - RefPtr stream = aWriter->GetStream(); - - // Step 2. Assert: stream is not undefined. - MOZ_ASSERT(stream); - - // Step 3. Let state be stream.[[state]]. - WritableStream::WriterState state = stream->State(); - - // Step 4. If ! WritableStreamCloseQueuedOrInFlight(stream) is true - // or state is "closed", return a promise resolved with undefined. - if (stream->CloseQueuedOrInFlight() || - state == WritableStream::WriterState::Closed) { - return Promise::CreateResolvedWithUndefined(aWriter->GetParentObject(), - aRv); - } - - // Step 5. If state is "errored", - // return a promise rejected with stream.[[storedError]]. - if (state == WritableStream::WriterState::Errored) { - RefPtr promise = Promise::Create(aWriter->GetParentObject(), aRv); - if (aRv.Failed()) { - return nullptr; - } - JS::Rooted error(aCx, stream->StoredError()); - promise->MaybeReject(error); - return promise.forget(); - } - - // Step 6. Assert: state is "writable" or "erroring". - MOZ_ASSERT(state == WritableStream::WriterState::Writable || - state == WritableStream::WriterState::Erroring); - - // Step 7. Return ! WritableStreamDefaultWriterClose(writer). - return WritableStreamDefaultWriterClose(aCx, aWriter, aRv); -} - } // namespace mozilla::dom diff --git a/dom/streams/WritableStreamDefaultWriter.h b/dom/streams/WritableStreamDefaultWriter.h index c02fd2df5475d..9edc5525a46bc 100644 --- a/dom/streams/WritableStreamDefaultWriter.h +++ b/dom/streams/WritableStreamDefaultWriter.h @@ -95,22 +95,6 @@ extern void WritableStreamDefaultWriterEnsureReadyPromiseRejected( WritableStreamDefaultWriter* aWriter, JS::Handle aError, ErrorResult& aRv); -extern Nullable WritableStreamDefaultWriterGetDesiredSize( - WritableStreamDefaultWriter* aWriter); - -extern void WritableStreamDefaultWriterRelease( - JSContext* aCx, WritableStreamDefaultWriter* aWriter, ErrorResult& aRv); - -MOZ_CAN_RUN_SCRIPT extern already_AddRefed -WritableStreamDefaultWriterWrite(JSContext* aCx, - WritableStreamDefaultWriter* aWriter, - JS::Handle aChunk, - ErrorResult& aRv); - -MOZ_CAN_RUN_SCRIPT extern already_AddRefed -WritableStreamDefaultWriterCloseWithErrorPropagation( - JSContext* aCx, WritableStreamDefaultWriter* aWriter, ErrorResult& aRv); - } // namespace mozilla::dom #endif // mozilla_dom_WritableStreamDefaultWriter_h diff --git a/dom/streams/moz.build b/dom/streams/moz.build index b53e14e9c5a07..01db9e14039d7 100644 --- a/dom/streams/moz.build +++ b/dom/streams/moz.build @@ -21,7 +21,6 @@ EXPORTS.mozilla.dom += [ "ReadableStreamDefaultController.h", "ReadableStreamDefaultReader.h", "ReadableStreamGenericReader.h", - "ReadableStreamPipeTo.h", "ReadableStreamTee.h", "ReadIntoRequest.h", "ReadRequest.h", @@ -46,7 +45,6 @@ UNIFIED_SOURCES += [ "ReadableStreamBYOBRequest.cpp", "ReadableStreamDefaultController.cpp", "ReadableStreamDefaultReader.cpp", - "ReadableStreamPipeTo.cpp", "ReadableStreamTee.cpp", "StreamUtils.cpp", "TeeState.cpp", diff --git a/dom/webidl/ReadableStream.webidl b/dom/webidl/ReadableStream.webidl index 3196260f6d56b..5bf5ee5d8a466 100644 --- a/dom/webidl/ReadableStream.webidl +++ b/dom/webidl/ReadableStream.webidl @@ -16,8 +16,8 @@ interface ReadableStream { // Bug 1734243 // ReadableStream pipeThrough(ReadableWritablePair transform, optional StreamPipeOptions options = {}); - [Pref="dom.streams.pipeTo.enabled", Throws] - Promise pipeTo(WritableStream destination, optional StreamPipeOptions options = {}); + // Bug 1734241 + // Promise pipeTo(WritableStream destination, optional StreamPipeOptions options = {}); [Throws] sequence tee(); @@ -31,10 +31,3 @@ enum ReadableStreamReaderMode { "byob" }; dictionary ReadableStreamGetReaderOptions { ReadableStreamReaderMode mode; }; - -dictionary StreamPipeOptions { - boolean preventClose = false; - boolean preventAbort = false; - boolean preventCancel = false; - AbortSignal signal; -}; diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 3a691b54aad0f..a311012f85ea0 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -3641,11 +3641,6 @@ value: false mirror: always -- name: dom.streams.pipeTo.enabled - type: RelaxedAtomicBool - value: false - mirror: always - # For area and anchor elements with target=_blank and no rel set to # opener/noopener. - name: dom.targetBlankNoOpener.enabled diff --git a/testing/web-platform/meta/streams/__dir__.ini b/testing/web-platform/meta/streams/__dir__.ini index ffbf62fdf9ad6..13ba4c559c617 100644 --- a/testing/web-platform/meta/streams/__dir__.ini +++ b/testing/web-platform/meta/streams/__dir__.ini @@ -1 +1 @@ -prefs: [javascript.options.streams:true,dom.streams.readable_stream_default_controller.enabled:true,dom.streams.readable_stream_default_reader.enabled:true,dom.streams.byte_streams.enabled:true,dom.streams.writable_streams.enabled:true,dom.streams.transform_streams.enabled:true,dom.streams.pipeTo.enabled:true] +prefs: [javascript.options.streams:true,dom.streams.readable_stream_default_controller.enabled:true,dom.streams.readable_stream_default_reader.enabled:true,dom.streams.byte_streams.enabled:true,dom.streams.writable_streams.enabled:true,dom.streams.transform_streams.enabled:true] diff --git a/testing/web-platform/meta/streams/idlharness.any.js.ini b/testing/web-platform/meta/streams/idlharness.any.js.ini index 37346df0c9ae1..59962e5b797cd 100644 --- a/testing/web-platform/meta/streams/idlharness.any.js.ini +++ b/testing/web-platform/meta/streams/idlharness.any.js.ini @@ -151,6 +151,9 @@ expected: if not domstreams: FAIL + [ReadableStream interface: operation pipeTo(WritableStream, optional StreamPipeOptions)] + expected: FAIL + [WritableStreamDefaultWriter interface object length] expected: if not domstreams: FAIL @@ -405,6 +408,9 @@ expected: if not domstreams: FAIL + [ReadableStream interface: calling pipeTo(WritableStream, optional StreamPipeOptions) on new ReadableStream() with too few arguments must throw TypeError] + expected: FAIL + [ReadableStreamBYOBReader interface: operation releaseLock()] expected: if not domstreams: FAIL @@ -417,6 +423,9 @@ expected: if not domstreams: FAIL + [ReadableStream interface: new ReadableStream() must inherit property "pipeTo(WritableStream, optional StreamPipeOptions)" with the proper type] + expected: FAIL + [ReadableByteStreamController interface: operation close()] expected: if not domstreams: FAIL @@ -813,6 +822,9 @@ expected: if not domstreams: FAIL + [ReadableStream interface: operation pipeTo(WritableStream, optional StreamPipeOptions)] + expected: FAIL + [WritableStreamDefaultWriter interface object length] expected: if not domstreams: FAIL @@ -1067,6 +1079,9 @@ expected: if not domstreams: FAIL + [ReadableStream interface: calling pipeTo(WritableStream, optional StreamPipeOptions) on new ReadableStream() with too few arguments must throw TypeError] + expected: FAIL + [ReadableStreamBYOBReader interface: operation releaseLock()] expected: if not domstreams: FAIL @@ -1079,6 +1094,9 @@ expected: if not domstreams: FAIL + [ReadableStream interface: new ReadableStream() must inherit property "pipeTo(WritableStream, optional StreamPipeOptions)" with the proper type] + expected: FAIL + [ReadableByteStreamController interface: operation close()] expected: if not domstreams: FAIL @@ -1475,6 +1493,9 @@ expected: if not domstreams: FAIL + [ReadableStream interface: operation pipeTo(WritableStream, optional StreamPipeOptions)] + expected: FAIL + [WritableStreamDefaultWriter interface object length] expected: if not domstreams: FAIL @@ -1729,6 +1750,9 @@ expected: if not domstreams: FAIL + [ReadableStream interface: calling pipeTo(WritableStream, optional StreamPipeOptions) on new ReadableStream() with too few arguments must throw TypeError] + expected: FAIL + [ReadableStreamBYOBReader interface: operation releaseLock()] expected: if not domstreams: FAIL @@ -1741,6 +1765,9 @@ expected: if not domstreams: FAIL + [ReadableStream interface: new ReadableStream() must inherit property "pipeTo(WritableStream, optional StreamPipeOptions)" with the proper type] + expected: FAIL + [ReadableByteStreamController interface: operation close()] expected: if not domstreams: FAIL @@ -2137,6 +2164,9 @@ expected: if not domstreams: FAIL + [ReadableStream interface: operation pipeTo(WritableStream, optional StreamPipeOptions)] + expected: FAIL + [WritableStreamDefaultWriter interface object length] expected: if not domstreams: FAIL @@ -2391,6 +2421,9 @@ expected: if not domstreams: FAIL + [ReadableStream interface: calling pipeTo(WritableStream, optional StreamPipeOptions) on new ReadableStream() with too few arguments must throw TypeError] + expected: FAIL + [ReadableStreamBYOBReader interface: operation releaseLock()] expected: if not domstreams: FAIL @@ -2403,6 +2436,9 @@ expected: if not domstreams: FAIL + [ReadableStream interface: new ReadableStream() must inherit property "pipeTo(WritableStream, optional StreamPipeOptions)" with the proper type] + expected: FAIL + [ReadableByteStreamController interface: operation close()] expected: if not domstreams: FAIL diff --git a/testing/web-platform/meta/streams/piping/abort.any.js.ini b/testing/web-platform/meta/streams/piping/abort.any.js.ini index 8e1c1f4b61613..b2c2b447dbf65 100644 --- a/testing/web-platform/meta/streams/piping/abort.any.js.ini +++ b/testing/web-platform/meta/streams/piping/abort.any.js.ini @@ -1,17 +1,354 @@ [abort.any.serviceworker.html] + [a signal argument 'null' should cause pipeTo() to reject] + expected: FAIL + + [a signal argument 'AbortSignal' should cause pipeTo() to reject] + expected: FAIL + + [a signal argument 'true' should cause pipeTo() to reject] + expected: FAIL + + [a signal argument '-1' should cause pipeTo() to reject] + expected: FAIL + + [a signal argument '[object AbortSignal\]' should cause pipeTo() to reject] + expected: FAIL + + [an aborted signal should cause the writable stream to reject with an AbortError] + expected: FAIL + + [(reason: 'null') all the error objects should be the same object] + expected: FAIL + + [(reason: 'undefined') all the error objects should be the same object] + expected: FAIL + + [(reason: 'error1: error1') all the error objects should be the same object] + expected: FAIL + + [preventCancel should prevent canceling the readable] + expected: FAIL + + [preventAbort should prevent aborting the readable] + expected: FAIL + + [preventCancel and preventAbort should prevent canceling the readable and aborting the readable] + expected: FAIL + + [(reason: 'null') abort should prevent further reads] + expected: FAIL + + [(reason: 'undefined') abort should prevent further reads] + expected: FAIL + + [(reason: 'error1: error1') abort should prevent further reads] + expected: FAIL + + [(reason: 'null') all pending writes should complete on abort] + expected: FAIL + + [(reason: 'undefined') all pending writes should complete on abort] + expected: FAIL + + [(reason: 'error1: error1') all pending writes should complete on abort] + expected: FAIL + + [a rejection from underlyingSource.cancel() should be returned by pipeTo()] + expected: FAIL + + [a rejection from underlyingSink.abort() should be returned by pipeTo()] + expected: FAIL + [a rejection from underlyingSink.abort() should be preferred to one from underlyingSource.cancel()] expected: FAIL + [abort signal takes priority over closed readable] + expected: FAIL + + [abort signal takes priority over errored readable] + expected: FAIL + + [abort signal takes priority over closed writable] + expected: FAIL + + [abort signal takes priority over errored writable] + expected: FAIL + + [abort should do nothing after the readable is closed] + expected: FAIL + + [abort should do nothing after the readable is errored] + expected: FAIL + + [abort should do nothing after the readable is errored, even with pending writes] + expected: FAIL + + [abort should do nothing after the writable is errored] + expected: FAIL + [abort.any.worker.html] + [a signal argument 'null' should cause pipeTo() to reject] + expected: FAIL + + [a signal argument 'AbortSignal' should cause pipeTo() to reject] + expected: FAIL + + [a signal argument 'true' should cause pipeTo() to reject] + expected: FAIL + + [a signal argument '-1' should cause pipeTo() to reject] + expected: FAIL + + [a signal argument '[object AbortSignal\]' should cause pipeTo() to reject] + expected: FAIL + + [an aborted signal should cause the writable stream to reject with an AbortError] + expected: FAIL + + [(reason: 'null') all the error objects should be the same object] + expected: FAIL + + [(reason: 'undefined') all the error objects should be the same object] + expected: FAIL + + [(reason: 'error1: error1') all the error objects should be the same object] + expected: FAIL + + [preventCancel should prevent canceling the readable] + expected: FAIL + + [preventAbort should prevent aborting the readable] + expected: FAIL + + [preventCancel and preventAbort should prevent canceling the readable and aborting the readable] + expected: FAIL + + [(reason: 'null') abort should prevent further reads] + expected: FAIL + + [(reason: 'undefined') abort should prevent further reads] + expected: FAIL + + [(reason: 'error1: error1') abort should prevent further reads] + expected: FAIL + + [(reason: 'null') all pending writes should complete on abort] + expected: FAIL + + [(reason: 'undefined') all pending writes should complete on abort] + expected: FAIL + + [(reason: 'error1: error1') all pending writes should complete on abort] + expected: FAIL + + [a rejection from underlyingSource.cancel() should be returned by pipeTo()] + expected: FAIL + + [a rejection from underlyingSink.abort() should be returned by pipeTo()] + expected: FAIL + [a rejection from underlyingSink.abort() should be preferred to one from underlyingSource.cancel()] expected: FAIL + [abort signal takes priority over closed readable] + expected: FAIL + + [abort signal takes priority over errored readable] + expected: FAIL + + [abort signal takes priority over closed writable] + expected: FAIL + + [abort signal takes priority over errored writable] + expected: FAIL + + [abort should do nothing after the readable is closed] + expected: FAIL + + [abort should do nothing after the readable is errored] + expected: FAIL + + [abort should do nothing after the readable is errored, even with pending writes] + expected: FAIL + + [abort should do nothing after the writable is errored] + expected: FAIL + [abort.any.sharedworker.html] + [a signal argument 'null' should cause pipeTo() to reject] + expected: FAIL + + [a signal argument 'AbortSignal' should cause pipeTo() to reject] + expected: FAIL + + [a signal argument 'true' should cause pipeTo() to reject] + expected: FAIL + + [a signal argument '-1' should cause pipeTo() to reject] + expected: FAIL + + [a signal argument '[object AbortSignal\]' should cause pipeTo() to reject] + expected: FAIL + + [an aborted signal should cause the writable stream to reject with an AbortError] + expected: FAIL + + [(reason: 'null') all the error objects should be the same object] + expected: FAIL + + [(reason: 'undefined') all the error objects should be the same object] + expected: FAIL + + [(reason: 'error1: error1') all the error objects should be the same object] + expected: FAIL + + [preventCancel should prevent canceling the readable] + expected: FAIL + + [preventAbort should prevent aborting the readable] + expected: FAIL + + [preventCancel and preventAbort should prevent canceling the readable and aborting the readable] + expected: FAIL + + [(reason: 'null') abort should prevent further reads] + expected: FAIL + + [(reason: 'undefined') abort should prevent further reads] + expected: FAIL + + [(reason: 'error1: error1') abort should prevent further reads] + expected: FAIL + + [(reason: 'null') all pending writes should complete on abort] + expected: FAIL + + [(reason: 'undefined') all pending writes should complete on abort] + expected: FAIL + + [(reason: 'error1: error1') all pending writes should complete on abort] + expected: FAIL + + [a rejection from underlyingSource.cancel() should be returned by pipeTo()] + expected: FAIL + + [a rejection from underlyingSink.abort() should be returned by pipeTo()] + expected: FAIL + [a rejection from underlyingSink.abort() should be preferred to one from underlyingSource.cancel()] expected: FAIL + [abort signal takes priority over closed readable] + expected: FAIL + + [abort signal takes priority over errored readable] + expected: FAIL + + [abort signal takes priority over closed writable] + expected: FAIL + + [abort signal takes priority over errored writable] + expected: FAIL + + [abort should do nothing after the readable is closed] + expected: FAIL + + [abort should do nothing after the readable is errored] + expected: FAIL + + [abort should do nothing after the readable is errored, even with pending writes] + expected: FAIL + + [abort should do nothing after the writable is errored] + expected: FAIL + + [abort.any.html] + [a signal argument 'null' should cause pipeTo() to reject] + expected: FAIL + + [a signal argument 'AbortSignal' should cause pipeTo() to reject] + expected: FAIL + + [a signal argument 'true' should cause pipeTo() to reject] + expected: FAIL + + [a signal argument '-1' should cause pipeTo() to reject] + expected: FAIL + + [a signal argument '[object AbortSignal\]' should cause pipeTo() to reject] + expected: FAIL + + [an aborted signal should cause the writable stream to reject with an AbortError] + expected: FAIL + + [(reason: 'null') all the error objects should be the same object] + expected: FAIL + + [(reason: 'undefined') all the error objects should be the same object] + expected: FAIL + + [(reason: 'error1: error1') all the error objects should be the same object] + expected: FAIL + + [preventCancel should prevent canceling the readable] + expected: FAIL + + [preventAbort should prevent aborting the readable] + expected: FAIL + + [preventCancel and preventAbort should prevent canceling the readable and aborting the readable] + expected: FAIL + + [(reason: 'null') abort should prevent further reads] + expected: FAIL + + [(reason: 'undefined') abort should prevent further reads] + expected: FAIL + + [(reason: 'error1: error1') abort should prevent further reads] + expected: FAIL + + [(reason: 'null') all pending writes should complete on abort] + expected: FAIL + + [(reason: 'undefined') all pending writes should complete on abort] + expected: FAIL + + [(reason: 'error1: error1') all pending writes should complete on abort] + expected: FAIL + + [a rejection from underlyingSource.cancel() should be returned by pipeTo()] + expected: FAIL + + [a rejection from underlyingSink.abort() should be returned by pipeTo()] + expected: FAIL + [a rejection from underlyingSink.abort() should be preferred to one from underlyingSource.cancel()] expected: FAIL + + [abort signal takes priority over closed readable] + expected: FAIL + + [abort signal takes priority over errored readable] + expected: FAIL + + [abort signal takes priority over closed writable] + expected: FAIL + + [abort signal takes priority over errored writable] + expected: FAIL + + [abort should do nothing after the readable is closed] + expected: FAIL + + [abort should do nothing after the readable is errored] + expected: FAIL + + [abort should do nothing after the readable is errored, even with pending writes] + expected: FAIL + + [abort should do nothing after the writable is errored] + expected: FAIL diff --git a/testing/web-platform/meta/streams/piping/close-propagation-backward.any.js.ini b/testing/web-platform/meta/streams/piping/close-propagation-backward.any.js.ini new file mode 100644 index 0000000000000..a9cf128bdccf2 --- /dev/null +++ b/testing/web-platform/meta/streams/piping/close-propagation-backward.any.js.ini @@ -0,0 +1,198 @@ +[close-propagation-backward.any.serviceworker.html] + [Closing must be propagated backward: starts closed; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = undefined (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = null (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = false (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = 0 (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = -0 (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = NaN (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = true (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = a (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = 1 (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = Symbol() (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = [object Object\] (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = true, preventAbort = true] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = true, preventAbort = true, preventClose = true] + expected: FAIL + + +[close-propagation-backward.any.worker.html] + [Closing must be propagated backward: starts closed; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = undefined (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = null (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = false (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = 0 (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = -0 (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = NaN (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = true (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = a (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = 1 (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = Symbol() (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = [object Object\] (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = true, preventAbort = true] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = true, preventAbort = true, preventClose = true] + expected: FAIL + + +[close-propagation-backward.any.html] + [Closing must be propagated backward: starts closed; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = undefined (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = null (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = false (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = 0 (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = -0 (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = NaN (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = true (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = a (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = 1 (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = Symbol() (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = [object Object\] (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = true, preventAbort = true] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = true, preventAbort = true, preventClose = true] + expected: FAIL + + +[close-propagation-backward.any.sharedworker.html] + [Closing must be propagated backward: starts closed; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = undefined (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = null (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = false (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = 0 (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = -0 (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = NaN (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = (falsy); fulfilled cancel promise] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = true (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = a (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = 1 (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = Symbol() (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = [object Object\] (truthy)] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = true, preventAbort = true] + expected: FAIL + + [Closing must be propagated backward: starts closed; preventCancel = true, preventAbort = true, preventClose = true] + expected: FAIL diff --git a/testing/web-platform/meta/streams/piping/close-propagation-forward.any.js.ini b/testing/web-platform/meta/streams/piping/close-propagation-forward.any.js.ini new file mode 100644 index 0000000000000..0ca2d29961af5 --- /dev/null +++ b/testing/web-platform/meta/streams/piping/close-propagation-forward.any.js.ini @@ -0,0 +1,366 @@ +[close-propagation-forward.any.worker.html] + [Closing must be propagated forward: starts closed; preventClose omitted; fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose omitted; rejected close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = undefined (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = null (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = false (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = 0 (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = -0 (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = NaN (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = true (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = a (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = 1 (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = Symbol() (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = [object Object\] (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = true, preventAbort = true] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = true, preventAbort = true, preventCancel = true] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; preventClose omitted; fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; preventClose omitted; rejected close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; dest never desires chunks; preventClose omitted; fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; dest never desires chunks; preventClose omitted; rejected close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; dest never desires chunks; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: becomes closed after one chunk; preventClose omitted; fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed after one chunk; preventClose omitted; rejected close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed after one chunk; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: shutdown must not occur until the final write completes] + expected: FAIL + + [Closing must be propagated forward: shutdown must not occur until the final write completes; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: shutdown must not occur until the final write completes; becomes closed after first write] + expected: FAIL + + [Closing must be propagated forward: shutdown must not occur until the final write completes; becomes closed after first write; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: erroring the writable while flushing pending writes should error pipeTo] + expected: FAIL + + +[close-propagation-forward.any.html] + [Closing must be propagated forward: starts closed; preventClose omitted; fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose omitted; rejected close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = undefined (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = null (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = false (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = 0 (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = -0 (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = NaN (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = true (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = a (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = 1 (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = Symbol() (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = [object Object\] (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = true, preventAbort = true] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = true, preventAbort = true, preventCancel = true] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; preventClose omitted; fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; preventClose omitted; rejected close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; dest never desires chunks; preventClose omitted; fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; dest never desires chunks; preventClose omitted; rejected close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; dest never desires chunks; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: becomes closed after one chunk; preventClose omitted; fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed after one chunk; preventClose omitted; rejected close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed after one chunk; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: shutdown must not occur until the final write completes] + expected: FAIL + + [Closing must be propagated forward: shutdown must not occur until the final write completes; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: shutdown must not occur until the final write completes; becomes closed after first write] + expected: FAIL + + [Closing must be propagated forward: shutdown must not occur until the final write completes; becomes closed after first write; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: erroring the writable while flushing pending writes should error pipeTo] + expected: FAIL + + +[close-propagation-forward.any.sharedworker.html] + [Closing must be propagated forward: starts closed; preventClose omitted; fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose omitted; rejected close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = undefined (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = null (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = false (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = 0 (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = -0 (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = NaN (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = true (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = a (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = 1 (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = Symbol() (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = [object Object\] (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = true, preventAbort = true] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = true, preventAbort = true, preventCancel = true] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; preventClose omitted; fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; preventClose omitted; rejected close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; dest never desires chunks; preventClose omitted; fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; dest never desires chunks; preventClose omitted; rejected close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; dest never desires chunks; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: becomes closed after one chunk; preventClose omitted; fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed after one chunk; preventClose omitted; rejected close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed after one chunk; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: shutdown must not occur until the final write completes] + expected: FAIL + + [Closing must be propagated forward: shutdown must not occur until the final write completes; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: shutdown must not occur until the final write completes; becomes closed after first write] + expected: FAIL + + [Closing must be propagated forward: shutdown must not occur until the final write completes; becomes closed after first write; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: erroring the writable while flushing pending writes should error pipeTo] + expected: FAIL + + +[close-propagation-forward.any.serviceworker.html] + [Closing must be propagated forward: starts closed; preventClose omitted; fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose omitted; rejected close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = undefined (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = null (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = false (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = 0 (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = -0 (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = NaN (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = (falsy); fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = true (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = a (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = 1 (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = Symbol() (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = [object Object\] (truthy)] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = true, preventAbort = true] + expected: FAIL + + [Closing must be propagated forward: starts closed; preventClose = true, preventAbort = true, preventCancel = true] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; preventClose omitted; fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; preventClose omitted; rejected close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; dest never desires chunks; preventClose omitted; fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; dest never desires chunks; preventClose omitted; rejected close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed asynchronously; dest never desires chunks; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: becomes closed after one chunk; preventClose omitted; fulfilled close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed after one chunk; preventClose omitted; rejected close promise] + expected: FAIL + + [Closing must be propagated forward: becomes closed after one chunk; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: shutdown must not occur until the final write completes] + expected: FAIL + + [Closing must be propagated forward: shutdown must not occur until the final write completes; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: shutdown must not occur until the final write completes; becomes closed after first write] + expected: FAIL + + [Closing must be propagated forward: shutdown must not occur until the final write completes; becomes closed after first write; preventClose = true] + expected: FAIL + + [Closing must be propagated forward: erroring the writable while flushing pending writes should error pipeTo] + expected: FAIL diff --git a/testing/web-platform/meta/streams/piping/error-propagation-backward.any.js.ini b/testing/web-platform/meta/streams/piping/error-propagation-backward.any.js.ini new file mode 100644 index 0000000000000..75a26da7837bc --- /dev/null +++ b/testing/web-platform/meta/streams/piping/error-propagation-backward.any.js.ini @@ -0,0 +1,426 @@ +[error-propagation-backward.any.html] + [Errors must be propagated backward: starts errored; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = undefined (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = null (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = false (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = 0 (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = -0 (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = NaN (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = true (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = a (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = 1 (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = Symbol() (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = [object Object\] (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write, preventCancel = true; preventAbort = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = true, preventAbort = true, preventClose = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = false; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = false; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping due to last write; source is closed; preventCancel omitted (but cancel is never called)] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping due to last write; source is closed; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = false; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = false; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping via abort; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping via abort; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping via abort; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: erroring via the controller errors once pending write completes] + expected: FAIL + + +[error-propagation-backward.any.worker.html] + [Errors must be propagated backward: starts errored; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = undefined (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = null (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = false (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = 0 (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = -0 (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = NaN (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = true (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = a (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = 1 (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = Symbol() (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = [object Object\] (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write, preventCancel = true; preventAbort = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = true, preventAbort = true, preventClose = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = false; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = false; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping due to last write; source is closed; preventCancel omitted (but cancel is never called)] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping due to last write; source is closed; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = false; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = false; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping via abort; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping via abort; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping via abort; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: erroring via the controller errors once pending write completes] + expected: FAIL + + +[error-propagation-backward.any.serviceworker.html] + [Errors must be propagated backward: starts errored; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = undefined (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = null (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = false (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = 0 (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = -0 (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = NaN (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = true (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = a (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = 1 (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = Symbol() (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = [object Object\] (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write, preventCancel = true; preventAbort = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = true, preventAbort = true, preventClose = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = false; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = false; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping due to last write; source is closed; preventCancel omitted (but cancel is never called)] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping due to last write; source is closed; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = false; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = false; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping via abort; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping via abort; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping via abort; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: erroring via the controller errors once pending write completes] + expected: FAIL + + +[error-propagation-backward.any.sharedworker.html] + [Errors must be propagated backward: starts errored; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = undefined (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = null (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = false (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = 0 (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = -0 (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = NaN (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = (falsy); fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = true (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = a (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = 1 (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = Symbol() (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = [object Object\] (truthy)] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write, preventCancel = true; preventAbort = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping due to write; preventCancel = true, preventAbort = true, preventClose = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = false; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = false; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping due to last write; source is closed; preventCancel omitted (but cancel is never called)] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping due to last write; source is closed; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = false; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = false; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping via abort; preventCancel omitted; fulfilled cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping via abort; preventCancel omitted; rejected cancel promise] + expected: FAIL + + [Errors must be propagated backward: becomes errored before piping via abort; preventCancel = true] + expected: FAIL + + [Errors must be propagated backward: erroring via the controller errors once pending write completes] + expected: FAIL diff --git a/testing/web-platform/meta/streams/piping/error-propagation-forward.any.js.ini b/testing/web-platform/meta/streams/piping/error-propagation-forward.any.js.ini new file mode 100644 index 0000000000000..eb78418d8977f --- /dev/null +++ b/testing/web-platform/meta/streams/piping/error-propagation-forward.any.js.ini @@ -0,0 +1,390 @@ +[error-propagation-forward.any.serviceworker.html] + [Errors must be propagated forward: starts errored; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = undefined (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = null (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = false (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = 0 (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = -0 (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = NaN (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = true (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = a (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = 1 (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = Symbol() (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = [object Object\] (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = true, preventCancel = true] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = true, preventCancel = true, preventClose = true] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; dest never desires chunks; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; dest never desires chunks; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; dest never desires chunks; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; dest never desires chunks; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; dest never desires chunks; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; dest never desires chunks; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: shutdown must not occur until the final write completes] + expected: FAIL + + [Errors must be propagated forward: shutdown must not occur until the final write completes; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: shutdown must not occur until the final write completes; becomes errored after first write] + expected: FAIL + + [Errors must be propagated forward: shutdown must not occur until the final write completes; becomes errored after first write; preventAbort = true] + expected: FAIL + + +[error-propagation-forward.any.worker.html] + [Errors must be propagated forward: starts errored; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = undefined (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = null (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = false (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = 0 (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = -0 (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = NaN (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = true (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = a (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = 1 (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = Symbol() (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = [object Object\] (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = true, preventCancel = true] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = true, preventCancel = true, preventClose = true] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; dest never desires chunks; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; dest never desires chunks; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; dest never desires chunks; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; dest never desires chunks; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; dest never desires chunks; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; dest never desires chunks; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: shutdown must not occur until the final write completes] + expected: FAIL + + [Errors must be propagated forward: shutdown must not occur until the final write completes; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: shutdown must not occur until the final write completes; becomes errored after first write] + expected: FAIL + + [Errors must be propagated forward: shutdown must not occur until the final write completes; becomes errored after first write; preventAbort = true] + expected: FAIL + + +[error-propagation-forward.any.html] + [Errors must be propagated forward: starts errored; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = undefined (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = null (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = false (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = 0 (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = -0 (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = NaN (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = true (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = a (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = 1 (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = Symbol() (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = [object Object\] (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = true, preventCancel = true] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = true, preventCancel = true, preventClose = true] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; dest never desires chunks; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; dest never desires chunks; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; dest never desires chunks; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; dest never desires chunks; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; dest never desires chunks; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; dest never desires chunks; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: shutdown must not occur until the final write completes] + expected: FAIL + + [Errors must be propagated forward: shutdown must not occur until the final write completes; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: shutdown must not occur until the final write completes; becomes errored after first write] + expected: FAIL + + [Errors must be propagated forward: shutdown must not occur until the final write completes; becomes errored after first write; preventAbort = true] + expected: FAIL + + +[error-propagation-forward.any.sharedworker.html] + [Errors must be propagated forward: starts errored; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = undefined (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = null (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = false (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = 0 (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = -0 (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = NaN (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = (falsy); fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = true (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = a (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = 1 (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = Symbol() (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = [object Object\] (truthy)] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = true, preventCancel = true] + expected: FAIL + + [Errors must be propagated forward: starts errored; preventAbort = true, preventCancel = true, preventClose = true] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; dest never desires chunks; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; dest never desires chunks; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored while empty; dest never desires chunks; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; dest never desires chunks; preventAbort = false; fulfilled abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; dest never desires chunks; preventAbort = false; rejected abort promise] + expected: FAIL + + [Errors must be propagated forward: becomes errored after one chunk; dest never desires chunks; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: shutdown must not occur until the final write completes] + expected: FAIL + + [Errors must be propagated forward: shutdown must not occur until the final write completes; preventAbort = true] + expected: FAIL + + [Errors must be propagated forward: shutdown must not occur until the final write completes; becomes errored after first write] + expected: FAIL + + [Errors must be propagated forward: shutdown must not occur until the final write completes; becomes errored after first write; preventAbort = true] + expected: FAIL diff --git a/testing/web-platform/meta/streams/piping/flow-control.any.js.ini b/testing/web-platform/meta/streams/piping/flow-control.any.js.ini new file mode 100644 index 0000000000000..9fd691ff81015 --- /dev/null +++ b/testing/web-platform/meta/streams/piping/flow-control.any.js.ini @@ -0,0 +1,66 @@ +[flow-control.any.worker.html] + [Piping from a non-empty ReadableStream into a WritableStream that does not desire chunks] + expected: FAIL + + [Piping from a non-empty ReadableStream into a WritableStream that does not desire chunks, but then does] + expected: FAIL + + [Piping from an empty ReadableStream into a WritableStream that does not desire chunks, but then the readable stream becomes non-empty and the writable stream starts desiring chunks] + expected: FAIL + + [Piping from a ReadableStream to a WritableStream that desires more chunks before finishing with previous ones] + expected: FAIL + + [Piping to a WritableStream that does not consume the writes fast enough exerts backpressure on the ReadableStream] + expected: FAIL + + +[flow-control.any.sharedworker.html] + [Piping from a non-empty ReadableStream into a WritableStream that does not desire chunks] + expected: FAIL + + [Piping from a non-empty ReadableStream into a WritableStream that does not desire chunks, but then does] + expected: FAIL + + [Piping from an empty ReadableStream into a WritableStream that does not desire chunks, but then the readable stream becomes non-empty and the writable stream starts desiring chunks] + expected: FAIL + + [Piping from a ReadableStream to a WritableStream that desires more chunks before finishing with previous ones] + expected: FAIL + + [Piping to a WritableStream that does not consume the writes fast enough exerts backpressure on the ReadableStream] + expected: FAIL + + +[flow-control.any.serviceworker.html] + [Piping from a non-empty ReadableStream into a WritableStream that does not desire chunks] + expected: FAIL + + [Piping from a non-empty ReadableStream into a WritableStream that does not desire chunks, but then does] + expected: FAIL + + [Piping from an empty ReadableStream into a WritableStream that does not desire chunks, but then the readable stream becomes non-empty and the writable stream starts desiring chunks] + expected: FAIL + + [Piping from a ReadableStream to a WritableStream that desires more chunks before finishing with previous ones] + expected: FAIL + + [Piping to a WritableStream that does not consume the writes fast enough exerts backpressure on the ReadableStream] + expected: FAIL + + +[flow-control.any.html] + [Piping from a non-empty ReadableStream into a WritableStream that does not desire chunks] + expected: FAIL + + [Piping from a non-empty ReadableStream into a WritableStream that does not desire chunks, but then does] + expected: FAIL + + [Piping from an empty ReadableStream into a WritableStream that does not desire chunks, but then the readable stream becomes non-empty and the writable stream starts desiring chunks] + expected: FAIL + + [Piping from a ReadableStream to a WritableStream that desires more chunks before finishing with previous ones] + expected: FAIL + + [Piping to a WritableStream that does not consume the writes fast enough exerts backpressure on the ReadableStream] + expected: FAIL diff --git a/testing/web-platform/meta/streams/piping/general.any.js.ini b/testing/web-platform/meta/streams/piping/general.any.js.ini new file mode 100644 index 0000000000000..ea11bc54ee4b5 --- /dev/null +++ b/testing/web-platform/meta/streams/piping/general.any.js.ini @@ -0,0 +1,174 @@ +[general.any.html] + [Piping must lock both the ReadableStream and WritableStream] + expected: FAIL + + [Piping finishing must unlock both the ReadableStream and WritableStream] + expected: FAIL + + [pipeTo must check the brand of its ReadableStream this value] + expected: FAIL + + [pipeTo must check the brand of its WritableStream argument] + expected: FAIL + + [pipeTo must fail if the ReadableStream is locked, and not lock the WritableStream] + expected: FAIL + + [pipeTo must fail if the WritableStream is locked, and not lock the ReadableStream] + expected: FAIL + + [Piping from a ReadableStream from which lots of chunks are synchronously readable] + expected: FAIL + + [Piping from a ReadableStream for which a chunk becomes asynchronously readable after the pipeTo] + expected: FAIL + + [an undefined rejection from pull should cause pipeTo() to reject when preventAbort is true] + expected: FAIL + + [an undefined rejection from pull should cause pipeTo() to reject when preventAbort is false] + expected: FAIL + + [an undefined rejection from write should cause pipeTo() to reject when preventCancel is true] + expected: FAIL + + [an undefined rejection from write should cause pipeTo() to reject when preventCancel is false] + expected: FAIL + + [pipeTo() should reject if an option getter grabs a writer] + expected: FAIL + + [pipeTo() promise should resolve if null is passed] + expected: FAIL + + +[general.any.serviceworker.html] + [Piping must lock both the ReadableStream and WritableStream] + expected: FAIL + + [Piping finishing must unlock both the ReadableStream and WritableStream] + expected: FAIL + + [pipeTo must check the brand of its ReadableStream this value] + expected: FAIL + + [pipeTo must check the brand of its WritableStream argument] + expected: FAIL + + [pipeTo must fail if the ReadableStream is locked, and not lock the WritableStream] + expected: FAIL + + [pipeTo must fail if the WritableStream is locked, and not lock the ReadableStream] + expected: FAIL + + [Piping from a ReadableStream from which lots of chunks are synchronously readable] + expected: FAIL + + [Piping from a ReadableStream for which a chunk becomes asynchronously readable after the pipeTo] + expected: FAIL + + [an undefined rejection from pull should cause pipeTo() to reject when preventAbort is true] + expected: FAIL + + [an undefined rejection from pull should cause pipeTo() to reject when preventAbort is false] + expected: FAIL + + [an undefined rejection from write should cause pipeTo() to reject when preventCancel is true] + expected: FAIL + + [an undefined rejection from write should cause pipeTo() to reject when preventCancel is false] + expected: FAIL + + [pipeTo() should reject if an option getter grabs a writer] + expected: FAIL + + [pipeTo() promise should resolve if null is passed] + expected: FAIL + + +[general.any.worker.html] + [Piping must lock both the ReadableStream and WritableStream] + expected: FAIL + + [Piping finishing must unlock both the ReadableStream and WritableStream] + expected: FAIL + + [pipeTo must check the brand of its ReadableStream this value] + expected: FAIL + + [pipeTo must check the brand of its WritableStream argument] + expected: FAIL + + [pipeTo must fail if the ReadableStream is locked, and not lock the WritableStream] + expected: FAIL + + [pipeTo must fail if the WritableStream is locked, and not lock the ReadableStream] + expected: FAIL + + [Piping from a ReadableStream from which lots of chunks are synchronously readable] + expected: FAIL + + [Piping from a ReadableStream for which a chunk becomes asynchronously readable after the pipeTo] + expected: FAIL + + [an undefined rejection from pull should cause pipeTo() to reject when preventAbort is true] + expected: FAIL + + [an undefined rejection from pull should cause pipeTo() to reject when preventAbort is false] + expected: FAIL + + [an undefined rejection from write should cause pipeTo() to reject when preventCancel is true] + expected: FAIL + + [an undefined rejection from write should cause pipeTo() to reject when preventCancel is false] + expected: FAIL + + [pipeTo() should reject if an option getter grabs a writer] + expected: FAIL + + [pipeTo() promise should resolve if null is passed] + expected: FAIL + + +[general.any.sharedworker.html] + [Piping must lock both the ReadableStream and WritableStream] + expected: FAIL + + [Piping finishing must unlock both the ReadableStream and WritableStream] + expected: FAIL + + [pipeTo must check the brand of its ReadableStream this value] + expected: FAIL + + [pipeTo must check the brand of its WritableStream argument] + expected: FAIL + + [pipeTo must fail if the ReadableStream is locked, and not lock the WritableStream] + expected: FAIL + + [pipeTo must fail if the WritableStream is locked, and not lock the ReadableStream] + expected: FAIL + + [Piping from a ReadableStream from which lots of chunks are synchronously readable] + expected: FAIL + + [Piping from a ReadableStream for which a chunk becomes asynchronously readable after the pipeTo] + expected: FAIL + + [an undefined rejection from pull should cause pipeTo() to reject when preventAbort is true] + expected: FAIL + + [an undefined rejection from pull should cause pipeTo() to reject when preventAbort is false] + expected: FAIL + + [an undefined rejection from write should cause pipeTo() to reject when preventCancel is true] + expected: FAIL + + [an undefined rejection from write should cause pipeTo() to reject when preventCancel is false] + expected: FAIL + + [pipeTo() should reject if an option getter grabs a writer] + expected: FAIL + + [pipeTo() promise should resolve if null is passed] + expected: FAIL diff --git a/testing/web-platform/meta/streams/piping/multiple-propagation.any.js.ini b/testing/web-platform/meta/streams/piping/multiple-propagation.any.js.ini new file mode 100644 index 0000000000000..a99e45244cd0c --- /dev/null +++ b/testing/web-platform/meta/streams/piping/multiple-propagation.any.js.ini @@ -0,0 +1,114 @@ +[multiple-propagation.any.serviceworker.html] + [Piping from an errored readable stream to an erroring writable stream] + expected: FAIL + + [Piping from an errored readable stream to an errored writable stream] + expected: FAIL + + [Piping from an errored readable stream to an erroring writable stream; preventAbort = true] + expected: FAIL + + [Piping from an errored readable stream to an errored writable stream; preventAbort = true] + expected: FAIL + + [Piping from an errored readable stream to a closing writable stream] + expected: FAIL + + [Piping from an errored readable stream to a closed writable stream] + expected: FAIL + + [Piping from a closed readable stream to an erroring writable stream] + expected: FAIL + + [Piping from a closed readable stream to an errored writable stream] + expected: FAIL + + [Piping from a closed readable stream to a closed writable stream] + expected: FAIL + + +[multiple-propagation.any.sharedworker.html] + [Piping from an errored readable stream to an erroring writable stream] + expected: FAIL + + [Piping from an errored readable stream to an errored writable stream] + expected: FAIL + + [Piping from an errored readable stream to an erroring writable stream; preventAbort = true] + expected: FAIL + + [Piping from an errored readable stream to an errored writable stream; preventAbort = true] + expected: FAIL + + [Piping from an errored readable stream to a closing writable stream] + expected: FAIL + + [Piping from an errored readable stream to a closed writable stream] + expected: FAIL + + [Piping from a closed readable stream to an erroring writable stream] + expected: FAIL + + [Piping from a closed readable stream to an errored writable stream] + expected: FAIL + + [Piping from a closed readable stream to a closed writable stream] + expected: FAIL + + +[multiple-propagation.any.worker.html] + [Piping from an errored readable stream to an erroring writable stream] + expected: FAIL + + [Piping from an errored readable stream to an errored writable stream] + expected: FAIL + + [Piping from an errored readable stream to an erroring writable stream; preventAbort = true] + expected: FAIL + + [Piping from an errored readable stream to an errored writable stream; preventAbort = true] + expected: FAIL + + [Piping from an errored readable stream to a closing writable stream] + expected: FAIL + + [Piping from an errored readable stream to a closed writable stream] + expected: FAIL + + [Piping from a closed readable stream to an erroring writable stream] + expected: FAIL + + [Piping from a closed readable stream to an errored writable stream] + expected: FAIL + + [Piping from a closed readable stream to a closed writable stream] + expected: FAIL + + +[multiple-propagation.any.html] + [Piping from an errored readable stream to an erroring writable stream] + expected: FAIL + + [Piping from an errored readable stream to an errored writable stream] + expected: FAIL + + [Piping from an errored readable stream to an erroring writable stream; preventAbort = true] + expected: FAIL + + [Piping from an errored readable stream to an errored writable stream; preventAbort = true] + expected: FAIL + + [Piping from an errored readable stream to a closing writable stream] + expected: FAIL + + [Piping from an errored readable stream to a closed writable stream] + expected: FAIL + + [Piping from a closed readable stream to an erroring writable stream] + expected: FAIL + + [Piping from a closed readable stream to an errored writable stream] + expected: FAIL + + [Piping from a closed readable stream to a closed writable stream] + expected: FAIL diff --git a/testing/web-platform/meta/streams/piping/then-interception.any.js.ini b/testing/web-platform/meta/streams/piping/then-interception.any.js.ini new file mode 100644 index 0000000000000..3ece60a8427da --- /dev/null +++ b/testing/web-platform/meta/streams/piping/then-interception.any.js.ini @@ -0,0 +1,30 @@ +[then-interception.any.worker.html] + [piping should not be observable] + expected: FAIL + + [tee should not be observable] + expected: FAIL + + +[then-interception.any.serviceworker.html] + [piping should not be observable] + expected: FAIL + + [tee should not be observable] + expected: FAIL + + +[then-interception.any.sharedworker.html] + [piping should not be observable] + expected: FAIL + + [tee should not be observable] + expected: FAIL + + +[then-interception.any.html] + [piping should not be observable] + expected: FAIL + + [tee should not be observable] + expected: FAIL diff --git a/testing/web-platform/meta/streams/piping/throwing-options.any.js.ini b/testing/web-platform/meta/streams/piping/throwing-options.any.js.ini index dadf62403ca45..2a3234cbecb3f 100644 --- a/testing/web-platform/meta/streams/piping/throwing-options.any.js.ini +++ b/testing/web-platform/meta/streams/piping/throwing-options.any.js.ini @@ -1,54 +1,102 @@ [throwing-options.any.worker.html] + [pipeTo should stop after getting preventAbort throws] + expected: FAIL + [pipeThrough should stop after getting preventAbort throws] expected: FAIL + [pipeTo should stop after getting preventCancel throws] + expected: FAIL + [pipeThrough should stop after getting preventCancel throws] expected: FAIL + [pipeTo should stop after getting preventClose throws] + expected: FAIL + [pipeThrough should stop after getting preventClose throws] expected: FAIL + [pipeTo should stop after getting signal throws] + expected: FAIL + [pipeThrough should stop after getting signal throws] expected: FAIL [throwing-options.any.html] + [pipeTo should stop after getting preventAbort throws] + expected: FAIL + [pipeThrough should stop after getting preventAbort throws] expected: FAIL + [pipeTo should stop after getting preventCancel throws] + expected: FAIL + [pipeThrough should stop after getting preventCancel throws] expected: FAIL + [pipeTo should stop after getting preventClose throws] + expected: FAIL + [pipeThrough should stop after getting preventClose throws] expected: FAIL + [pipeTo should stop after getting signal throws] + expected: FAIL + [pipeThrough should stop after getting signal throws] expected: FAIL [throwing-options.any.sharedworker.html] + [pipeTo should stop after getting preventAbort throws] + expected: FAIL + [pipeThrough should stop after getting preventAbort throws] expected: FAIL + [pipeTo should stop after getting preventCancel throws] + expected: FAIL + [pipeThrough should stop after getting preventCancel throws] expected: FAIL + [pipeTo should stop after getting preventClose throws] + expected: FAIL + [pipeThrough should stop after getting preventClose throws] expected: FAIL + [pipeTo should stop after getting signal throws] + expected: FAIL + [pipeThrough should stop after getting signal throws] expected: FAIL [throwing-options.any.serviceworker.html] + [pipeTo should stop after getting preventAbort throws] + expected: FAIL + [pipeThrough should stop after getting preventAbort throws] expected: FAIL + [pipeTo should stop after getting preventCancel throws] + expected: FAIL + [pipeThrough should stop after getting preventCancel throws] expected: FAIL + [pipeTo should stop after getting preventClose throws] + expected: FAIL + [pipeThrough should stop after getting preventClose throws] expected: FAIL + [pipeTo should stop after getting signal throws] + expected: FAIL + [pipeThrough should stop after getting signal throws] expected: FAIL diff --git a/testing/web-platform/meta/streams/readable-streams/patched-global.any.js.ini b/testing/web-platform/meta/streams/readable-streams/patched-global.any.js.ini index ebd9fba5b176c..109e4d887041c 100644 --- a/testing/web-platform/meta/streams/readable-streams/patched-global.any.js.ini +++ b/testing/web-platform/meta/streams/readable-streams/patched-global.any.js.ini @@ -1,18 +1,30 @@ [patched-global.any.serviceworker.html] + [pipeTo() should not call Promise.prototype.then()] + expected: FAIL + [ReadableStream async iterator should use the original values of getReader() and ReadableStreamDefaultReader methods] expected: FAIL [patched-global.any.sharedworker.html] + [pipeTo() should not call Promise.prototype.then()] + expected: FAIL + [ReadableStream async iterator should use the original values of getReader() and ReadableStreamDefaultReader methods] expected: FAIL [patched-global.any.worker.html] + [pipeTo() should not call Promise.prototype.then()] + expected: FAIL + [ReadableStream async iterator should use the original values of getReader() and ReadableStreamDefaultReader methods] expected: FAIL [patched-global.any.html] + [pipeTo() should not call Promise.prototype.then()] + expected: FAIL + [ReadableStream async iterator should use the original values of getReader() and ReadableStreamDefaultReader methods] expected: FAIL diff --git a/testing/web-platform/meta/streams/readable-streams/reentrant-strategies.any.js.ini b/testing/web-platform/meta/streams/readable-streams/reentrant-strategies.any.js.ini new file mode 100644 index 0000000000000..115307d471477 --- /dev/null +++ b/testing/web-platform/meta/streams/readable-streams/reentrant-strategies.any.js.ini @@ -0,0 +1,19 @@ +[reentrant-strategies.any.worker.html] + [pipeTo() inside size() should behave as expected] + expected: FAIL + + +[reentrant-strategies.any.serviceworker.html] + [pipeTo() inside size() should behave as expected] + expected: FAIL + + +[reentrant-strategies.any.html] + [pipeTo() inside size() should behave as expected] + expected: FAIL + + +[reentrant-strategies.any.sharedworker.html] + [pipeTo() inside size() should behave as expected] + expected: FAIL +