#include "third_party/blink/renderer/modules/direct_sockets/tcp_writable_stream_wrapper.h"
#include "base/containers/span.h"
#include "base/functional/callback_helpers.h"
#include "base/ranges/algorithm.h"
#include "base/test/mock_callback.h"
#include "net/base/net_errors.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_tester.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.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/direct_sockets/stream_wrapper.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
namespace blink {
namespace {
ElementsAre;
StrictMock;
class StreamCreator : public GarbageCollected<StreamCreator> { … };
class ScopedStreamCreator { … };
TEST(TCPWritableStreamWrapperTest, Create) { … }
TEST(TCPWritableStreamWrapperTest, WriteArrayBuffer) { … }
TEST(TCPWritableStreamWrapperTest, WriteArrayBufferView) { … }
bool IsAllNulls(base::span<const uint8_t> data) { … }
TEST(TCPWritableStreamWrapperTest, AsyncWrite) { … }
TEST(TCPWritableStreamWrapperTest, WriteThenClose) { … }
TEST(TCPWritableStreamWrapperTest, DISABLED_TriggerHasAborted) { … }
class TCPWritableStreamWrapperCloseTestWithMaybePendingWrite
: public testing::TestWithParam<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(TCPWritableStreamWrapperCloseTestWithMaybePendingWrite, TriggerClose) { … }
TEST_P(TCPWritableStreamWrapperCloseTestWithMaybePendingWrite,
TriggerCloseInReverseOrder) { … }
}
}