| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 { | 82 { |
| 83 DOMWebSocketWithMockChannel* websocket = new DOMWebSocketWithMockChannel
(context); | 83 DOMWebSocketWithMockChannel* websocket = new DOMWebSocketWithMockChannel
(context); |
| 84 websocket->suspendIfNeeded(); | 84 websocket->suspendIfNeeded(); |
| 85 return websocket; | 85 return websocket; |
| 86 } | 86 } |
| 87 | 87 |
| 88 MockWebSocketChannel* channel() { return m_channel.get(); } | 88 MockWebSocketChannel* channel() { return m_channel.get(); } |
| 89 | 89 |
| 90 WebSocketChannel* createChannel(ExecutionContext*, WebSocketChannelClient*)
override | 90 WebSocketChannel* createChannel(ExecutionContext*, WebSocketChannelClient*)
override |
| 91 { | 91 { |
| 92 ASSERT(!m_hasCreatedChannel); | 92 DCHECK(!m_hasCreatedChannel); |
| 93 m_hasCreatedChannel = true; | 93 m_hasCreatedChannel = true; |
| 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 |
| (...skipping 706 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 |