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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "modules/websockets/DOMWebSocket.h" | 7 #include "modules/websockets/DOMWebSocket.h" |
8 | 8 |
9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
10 #include "bindings/core/v8/V8Binding.h" | 10 #include "bindings/core/v8/V8Binding.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include <gmock/gmock.h> | 21 #include <gmock/gmock.h> |
22 #include <gtest/gtest.h> | 22 #include <gtest/gtest.h> |
23 #include <v8.h> | 23 #include <v8.h> |
24 | 24 |
25 using testing::_; | 25 using testing::_; |
26 using testing::AnyNumber; | 26 using testing::AnyNumber; |
27 using testing::InSequence; | 27 using testing::InSequence; |
28 using testing::Ref; | 28 using testing::Ref; |
29 using testing::Return; | 29 using testing::Return; |
30 | 30 |
31 namespace WebCore { | 31 namespace blink { |
32 | 32 |
33 namespace { | 33 namespace { |
34 | 34 |
35 typedef testing::StrictMock<testing::MockFunction<void(int)> > Checkpoint; // N
OLINT | 35 typedef testing::StrictMock<testing::MockFunction<void(int)> > Checkpoint; // N
OLINT |
36 | 36 |
37 class MockWebSocketChannel : public WebSocketChannel { | 37 class MockWebSocketChannel : public WebSocketChannel { |
38 public: | 38 public: |
39 static PassRefPtrWillBeRawPtr<MockWebSocketChannel> create() | 39 static PassRefPtrWillBeRawPtr<MockWebSocketChannel> create() |
40 { | 40 { |
41 return adoptRefWillBeRefCountedGarbageCollected(new testing::StrictMock<
MockWebSocketChannel>()); | 41 return adoptRefWillBeRefCountedGarbageCollected(new testing::StrictMock<
MockWebSocketChannel>()); |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 EXPECT_TRUE(m_exceptionState.hadException()); | 784 EXPECT_TRUE(m_exceptionState.hadException()); |
785 EXPECT_EQ(InvalidAccessError, m_exceptionState.code()); | 785 EXPECT_EQ(InvalidAccessError, m_exceptionState.code()); |
786 EXPECT_EQ(String::format("The code must be either 1000, or between 3000 and
4999. %d is neither.", GetParam()), m_exceptionState.message()); | 786 EXPECT_EQ(String::format("The code must be either 1000, or between 3000 and
4999. %d is neither.", GetParam()), m_exceptionState.message()); |
787 EXPECT_EQ(DOMWebSocket::CONNECTING, m_websocket->readyState()); | 787 EXPECT_EQ(DOMWebSocket::CONNECTING, m_websocket->readyState()); |
788 } | 788 } |
789 | 789 |
790 INSTANTIATE_TEST_CASE_P(DOMWebSocketInvalidClosingCode, DOMWebSocketInvalidClosi
ngCodeTest, ::testing::Values(0, 1, 998, 999, 1001, 2999, 5000, 9999, 65535)); | 790 INSTANTIATE_TEST_CASE_P(DOMWebSocketInvalidClosingCode, DOMWebSocketInvalidClosi
ngCodeTest, ::testing::Values(0, 1, 998, 999, 1001, 2999, 5000, 9999, 65535)); |
791 | 791 |
792 } // namespace | 792 } // namespace |
793 | 793 |
794 } // namespace WebCore | 794 } // namespace blink |
OLD | NEW |