| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 return m_channel.get(); | 94 return m_channel.get(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 DEFINE_INLINE_VIRTUAL_TRACE() | 97 DEFINE_INLINE_VIRTUAL_TRACE() |
| 98 { | 98 { |
| 99 visitor->trace(m_channel); | 99 visitor->trace(m_channel); |
| 100 DOMWebSocket::trace(visitor); | 100 DOMWebSocket::trace(visitor); |
| 101 } | 101 } |
| 102 | 102 |
| 103 private: | 103 private: |
| 104 DOMWebSocketWithMockChannel(ExecutionContext* context) | 104 explicit DOMWebSocketWithMockChannel(ExecutionContext* context) |
| 105 : DOMWebSocket(context) | 105 : DOMWebSocket(context) |
| 106 , m_channel(MockWebSocketChannel::create()) | 106 , m_channel(MockWebSocketChannel::create()) |
| 107 , m_hasCreatedChannel(false) { } | 107 , m_hasCreatedChannel(false) { } |
| 108 | 108 |
| 109 Member<MockWebSocketChannel> m_channel; | 109 Member<MockWebSocketChannel> m_channel; |
| 110 bool m_hasCreatedChannel; | 110 bool m_hasCreatedChannel; |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 class DOMWebSocketTestScope { | 113 class DOMWebSocketTestScope { |
| 114 public: | 114 public: |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 EXPECT_EQ(InvalidAccessError, scope.getExceptionState().code()); | 809 EXPECT_EQ(InvalidAccessError, scope.getExceptionState().code()); |
| 810 EXPECT_EQ(String::format("The code must be either 1000, or between 3000 and
4999. %d is neither.", GetParam()), scope.getExceptionState().message()); | 810 EXPECT_EQ(String::format("The code must be either 1000, or between 3000 and
4999. %d is neither.", GetParam()), scope.getExceptionState().message()); |
| 811 EXPECT_EQ(DOMWebSocket::kConnecting, webSocketScope.socket().readyState()); | 811 EXPECT_EQ(DOMWebSocket::kConnecting, webSocketScope.socket().readyState()); |
| 812 } | 812 } |
| 813 | 813 |
| 814 INSTANTIATE_TEST_CASE_P(DOMWebSocketInvalidClosingCode, DOMWebSocketInvalidClosi
ngCodeTest, ::testing::Values(0, 1, 998, 999, 1001, 2999, 5000, 9999, 65535)); | 814 INSTANTIATE_TEST_CASE_P(DOMWebSocketInvalidClosingCode, DOMWebSocketInvalidClosi
ngCodeTest, ::testing::Values(0, 1, 998, 999, 1001, 2999, 5000, 9999, 65535)); |
| 815 | 815 |
| 816 } // namespace | 816 } // namespace |
| 817 | 817 |
| 818 } // namespace blink | 818 } // namespace blink |
| OLD | NEW |