#include "third_party/blink/renderer/modules/direct_sockets/udp_writable_stream_wrapper.h"
#include "base/containers/span.h"
#include "base/functional/bind.h"
#include "base/notreached.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "net/base/net_errors.h"
#include "services/network/public/mojom/restricted_udp_socket.mojom-blink.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/bindings/core/v8/v8_throw_dom_exception.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_arraybuffer_arraybufferview.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_udp_message.h"
#include "third_party/blink/renderer/core/dom/dom_exception.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_array_buffer.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.h"
#include "third_party/blink/renderer/modules/direct_sockets/udp_socket_mojo_remote.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/heap/persistent.h"
#include "third_party/blink/renderer/platform/mojo/heap_mojo_receiver.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/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/gc_plugin.h"
#include "third_party/googletest/src/googlemock/include/gmock/gmock-matchers.h"
namespace blink {
namespace {
class FakeRestrictedUDPSocket
: public GarbageCollected<FakeRestrictedUDPSocket>,
public network::mojom::blink::RestrictedUDPSocket { … };
class StreamCreator : public GarbageCollected<StreamCreator> { … };
class ScopedStreamCreator { … };
TEST(UDPWritableStreamWrapperTest, Create) { … }
TEST(UDPWritableStreamWrapperTest, WriteUdpMessage) { … }
TEST(UDPWritableStreamWrapperTest, WriteUdpMessageFromTypedArray) { … }
TEST(UDPWritableStreamWrapperTest, WriteUdpMessageWithEmptyDataFieldFails) { … }
TEST(UDPWritableStreamWrapperTest, WriteAfterFinishedWrite) { … }
TEST(UDPWritableStreamWrapperTest, WriteAfterClose) { … }
TEST(UDPWritableStreamWrapperTest, WriteFailed) { … }
}
}