#include "third_party/blink/renderer/modules/webtransport/bidirectional_stream.h"
#include <memory>
#include <utility>
#include "base/containers/span.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/network/public/mojom/web_transport.mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/webtransport/web_transport_connector.mojom-blink.h"
#include "third_party/blink/public/platform/browser_interface_broker_proxy.h"
#include "third_party/blink/renderer/bindings/core/v8/iterable.h"
#include "third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_tester.h"
#include "third_party/blink/renderer/bindings/core/v8/script_value.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_web_transport_bidirectional_stream.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_web_transport_options.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/streams/readable_stream.h"
#include "third_party/blink/renderer/core/streams/readable_stream_default_reader.h"
#include "third_party/blink/renderer/core/streams/writable_stream.h"
#include "third_party/blink/renderer/core/streams/writable_stream_default_writer.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.h"
#include "third_party/blink/renderer/modules/webtransport/test_utils.h"
#include "third_party/blink/renderer/modules/webtransport/web_transport.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "v8/include/v8.h"
namespace blink {
namespace {
constexpr uint32_t kDefaultStreamId = …;
class StubWebTransport : public network::mojom::blink::WebTransport { … };
class ScopedWebTransport { … };
void TestWrite(const V8TestingScope& scope,
ScopedWebTransport* scoped_web_transport,
BidirectionalStream* bidirectional_stream) { … }
TEST(BidirectionalStreamTest, CreateLocallyAndWrite) { … }
TEST(BidirectionalStreamTest, CreateRemotelyAndWrite) { … }
void TestRead(V8TestingScope& scope,
ScopedWebTransport* scoped_web_transport,
BidirectionalStream* bidirectional_stream) { … }
TEST(BidirectionalStreamTest, CreateLocallyAndRead) { … }
TEST(BidirectionalStreamTest, CreateRemotelyAndRead) { … }
TEST(BidirectionalStreamTest, IncomingStreamCleanClose) { … }
TEST(BidirectionalStreamTest, OutgoingStreamCleanClose) { … }
TEST(BidirectionalStreamTest, CloseWebTransport) { … }
TEST(BidirectionalStreamTest, RemoteDropWebTransport) { … }
TEST(BidirectionalStreamTest, WriteAfterCancellingIncoming) { … }
TEST(BidirectionalStreamTest, WriteAfterIncomingClosed) { … }
TEST(BidirectionalStreamTest, ReadAfterClosingOutgoing) { … }
TEST(BidirectionalStreamTest, ReadAfterAbortingOutgoing) { … }
TEST(BidirectionalStreamTest, ReadAfterOutgoingAborted) { … }
}
}