#include "third_party/blink/renderer/modules/direct_sockets/tcp_socket.h"
#include "mojo/public/cpp/system/data_pipe.h"
#include "net/base/net_errors.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise.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/bindings/core/v8/v8_dom_exception.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/streams/readable_stream.h"
#include "third_party/blink/renderer/core/streams/writable_stream.h"
#include "third_party/blink/renderer/modules/direct_sockets/stream_wrapper.h"
#include "third_party/blink/renderer/modules/direct_sockets/tcp_readable_stream_wrapper.h"
#include "third_party/blink/renderer/platform/bindings/exception_code.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 {
std::pair<mojo::ScopedDataPipeProducerHandle,
mojo::ScopedDataPipeConsumerHandle>
CreateDataPipe(int32_t capacity = 1) { … }
}
TEST(TCPSocketTest, CloseBeforeInit) { … }
TEST(TCPSocketTest, CloseAfterInitWithResultOK) { … }
TEST(TCPSocketTest, OnSocketObserverConnectionError) { … }
class TCPSocketCloseTest
: public testing::TestWithParam<std::tuple<bool, bool>> { … };
TEST_P(TCPSocketCloseTest, OnErrorOrClose) { … }
INSTANTIATE_TEST_SUITE_P(…);
}