OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/websockets/DOMWebSocket.h" | 5 #include "modules/websockets/DOMWebSocket.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
9 #include "bindings/core/v8/V8BindingForTesting.h" | 9 #include "bindings/core/v8/V8BindingForTesting.h" |
10 #include "core/dom/DOMTypedArray.h" | 10 #include "core/dom/DOMTypedArray.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 } | 47 } |
48 | 48 |
49 MOCK_METHOD2(connect, bool(const KURL&, const String&)); | 49 MOCK_METHOD2(connect, bool(const KURL&, const String&)); |
50 MOCK_METHOD1(send, void(const CString&)); | 50 MOCK_METHOD1(send, void(const CString&)); |
51 MOCK_METHOD3(send, void(const DOMArrayBuffer&, unsigned, unsigned)); | 51 MOCK_METHOD3(send, void(const DOMArrayBuffer&, unsigned, unsigned)); |
52 MOCK_METHOD1(send, void(PassRefPtr<BlobDataHandle>)); | 52 MOCK_METHOD1(send, void(PassRefPtr<BlobDataHandle>)); |
53 MOCK_METHOD1(sendTextAsCharVector, void(PassOwnPtr<Vector<char>>)); | 53 MOCK_METHOD1(sendTextAsCharVector, void(PassOwnPtr<Vector<char>>)); |
54 MOCK_METHOD1(sendBinaryAsCharVector, void(PassOwnPtr<Vector<char>>)); | 54 MOCK_METHOD1(sendBinaryAsCharVector, void(PassOwnPtr<Vector<char>>)); |
55 MOCK_CONST_METHOD0(bufferedAmount, unsigned()); | 55 MOCK_CONST_METHOD0(bufferedAmount, unsigned()); |
56 MOCK_METHOD2(close, void(int, const String&)); | 56 MOCK_METHOD2(close, void(int, const String&)); |
| 57 MOCK_METHOD1(changeBinaryType, void(BinaryType)); |
57 MOCK_METHOD4(fail, void(const String&, MessageLevel, const String&, unsigned
)); | 58 MOCK_METHOD4(fail, void(const String&, MessageLevel, const String&, unsigned
)); |
58 MOCK_METHOD0(disconnect, void()); | 59 MOCK_METHOD0(disconnect, void()); |
59 | 60 |
60 MockWebSocketChannel() | 61 MockWebSocketChannel() |
61 { | 62 { |
62 } | 63 } |
63 }; | 64 }; |
64 | 65 |
65 class DOMWebSocketWithMockChannel final : public DOMWebSocket { | 66 class DOMWebSocketWithMockChannel final : public DOMWebSocket { |
66 public: | 67 public: |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 EXPECT_EQ(InvalidAccessError, m_exceptionState.code()); | 746 EXPECT_EQ(InvalidAccessError, m_exceptionState.code()); |
746 EXPECT_EQ(String::format("The code must be either 1000, or between 3000 and
4999. %d is neither.", GetParam()), m_exceptionState.message()); | 747 EXPECT_EQ(String::format("The code must be either 1000, or between 3000 and
4999. %d is neither.", GetParam()), m_exceptionState.message()); |
747 EXPECT_EQ(DOMWebSocket::CONNECTING, m_websocket->readyState()); | 748 EXPECT_EQ(DOMWebSocket::CONNECTING, m_websocket->readyState()); |
748 } | 749 } |
749 | 750 |
750 INSTANTIATE_TEST_CASE_P(DOMWebSocketInvalidClosingCode, DOMWebSocketInvalidClosi
ngCodeTest, ::testing::Values(0, 1, 998, 999, 1001, 2999, 5000, 9999, 65535)); | 751 INSTANTIATE_TEST_CASE_P(DOMWebSocketInvalidClosingCode, DOMWebSocketInvalidClosi
ngCodeTest, ::testing::Values(0, 1, 998, 999, 1001, 2999, 5000, 9999, 65535)); |
751 | 752 |
752 } // namespace | 753 } // namespace |
753 | 754 |
754 } // namespace blink | 755 } // namespace blink |
OLD | NEW |