chromium/third_party/blink/renderer/modules/websockets/websocket_stream_test.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Most testing for WebSocketStream is done via web platform tests. These unit
// tests just cover the most common functionality.

#include "third_party/blink/renderer/modules/websockets/websocket_stream.h"

#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/devtools/console_message.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/script_value.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/modules/v8/v8_websocket_close_info.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_websocket_error.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_websocket_stream_options.h"
#include "third_party/blink/renderer/core/dom/abort_controller.h"
#include "third_party/blink/renderer/core/dom/abort_signal.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/modules/websockets/mock_websocket_channel.h"
#include "third_party/blink/renderer/modules/websockets/websocket_channel.h"
#include "third_party/blink/renderer/modules/websockets/websocket_channel_client.h"
#include "third_party/blink/renderer/platform/bindings/exception_code.h"
#include "third_party/blink/renderer/platform/bindings/v8_binding.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 {

_;
AnyNumber;
InSequence;
Return;

Checkpoint;  // NOLINT

class WebSocketStreamTest : public ::testing::Test {};

TEST_F(WebSocketStreamTest, ConstructWithBadURL) {}

// Most coverage for bad constructor arguments is provided by
// dom_websocket_test.cc.
// TODO(ricea): Should we duplicate those tests here?

TEST_F(WebSocketStreamTest, Connect) {}

TEST_F(WebSocketStreamTest, ConnectWithProtocols) {}

TEST_F(WebSocketStreamTest, ConnectWithFailedHandshake) {}

TEST_F(WebSocketStreamTest, ConnectWithSuccessfulHandshake) {}

TEST_F(WebSocketStreamTest, ConnectThenCloseCleanly) {}

TEST_F(WebSocketStreamTest, CloseDuringHandshake) {}

TEST_F(WebSocketStreamTest, AbortBeforeHandshake) {}

TEST_F(WebSocketStreamTest, AbortDuringHandshake) {}

// Aborting after the handshake is complete does nothing.
TEST_F(WebSocketStreamTest, AbortAfterHandshake) {}

}  // namespace

}  // namespace blink