Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: Source/modules/websockets/DocumentWebSocketChannelTest.cpp

Issue 1227783004: Fix virtual/override/final usage in Source/modules/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "modules/websockets/WebSocketChannel.h" 6 #include "modules/websockets/WebSocketChannel.h"
7 7
8 #include "core/dom/DOMArrayBuffer.h" 8 #include "core/dom/DOMArrayBuffer.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/fileapi/Blob.h" 10 #include "core/fileapi/Blob.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 class MockWebSocketChannelClient : public GarbageCollectedFinalized<MockWebSocke tChannelClient>, public WebSocketChannelClient { 43 class MockWebSocketChannelClient : public GarbageCollectedFinalized<MockWebSocke tChannelClient>, public WebSocketChannelClient {
44 USING_GARBAGE_COLLECTED_MIXIN(MockWebSocketChannelClient); 44 USING_GARBAGE_COLLECTED_MIXIN(MockWebSocketChannelClient);
45 public: 45 public:
46 static MockWebSocketChannelClient* create() 46 static MockWebSocketChannelClient* create()
47 { 47 {
48 return new testing::StrictMock<MockWebSocketChannelClient>(); 48 return new testing::StrictMock<MockWebSocketChannelClient>();
49 } 49 }
50 50
51 MockWebSocketChannelClient() { } 51 MockWebSocketChannelClient() { }
52 52
53 virtual ~MockWebSocketChannelClient() { } 53 ~MockWebSocketChannelClient() override { }
54 54
55 MOCK_METHOD2(didConnect, void(const String&, const String&)); 55 MOCK_METHOD2(didConnect, void(const String&, const String&));
56 MOCK_METHOD1(didReceiveTextMessage, void(const String&)); 56 MOCK_METHOD1(didReceiveTextMessage, void(const String&));
57 virtual void didReceiveBinaryMessage(PassOwnPtr<Vector<char>> payload) overr ide 57 void didReceiveBinaryMessage(PassOwnPtr<Vector<char>> payload) override
58 { 58 {
59 didReceiveBinaryMessageMock(*payload); 59 didReceiveBinaryMessageMock(*payload);
60 } 60 }
61 MOCK_METHOD1(didReceiveBinaryMessageMock, void(const Vector<char>&)); 61 MOCK_METHOD1(didReceiveBinaryMessageMock, void(const Vector<char>&));
62 MOCK_METHOD0(didError, void()); 62 MOCK_METHOD0(didError, void());
63 MOCK_METHOD1(didConsumeBufferedAmount, void(uint64_t)); 63 MOCK_METHOD1(didConsumeBufferedAmount, void(uint64_t));
64 MOCK_METHOD0(didStartClosingHandshake, void()); 64 MOCK_METHOD0(didStartClosingHandshake, void());
65 MOCK_METHOD3(didClose, void(ClosingHandshakeCompletionStatus, unsigned short , const String&)); 65 MOCK_METHOD3(didClose, void(ClosingHandshakeCompletionStatus, unsigned short , const String&));
66 66
67 DEFINE_INLINE_VIRTUAL_TRACE() 67 DEFINE_INLINE_VIRTUAL_TRACE()
68 { 68 {
69 WebSocketChannelClient::trace(visitor); 69 WebSocketChannelClient::trace(visitor);
70 } 70 }
71 71
72 }; 72 };
73 73
74 class MockWebSocketHandle : public WebSocketHandle { 74 class MockWebSocketHandle : public WebSocketHandle {
75 public: 75 public:
76 static MockWebSocketHandle* create() 76 static MockWebSocketHandle* create()
77 { 77 {
78 return new testing::StrictMock<MockWebSocketHandle>(); 78 return new testing::StrictMock<MockWebSocketHandle>();
79 } 79 }
80 80
81 MockWebSocketHandle() { } 81 MockWebSocketHandle() { }
82 82
83 virtual ~MockWebSocketHandle() { } 83 ~MockWebSocketHandle() override { }
84 84
85 MOCK_METHOD4(connect, void(const WebURL&, const WebVector<WebString>&, const WebSerializedOrigin&, WebSocketHandleClient*)); 85 MOCK_METHOD4(connect, void(const WebURL&, const WebVector<WebString>&, const WebSerializedOrigin&, WebSocketHandleClient*));
86 MOCK_METHOD4(send, void(bool, WebSocketHandle::MessageType, const char*, siz e_t)); 86 MOCK_METHOD4(send, void(bool, WebSocketHandle::MessageType, const char*, siz e_t));
87 MOCK_METHOD1(flowControl, void(int64_t)); 87 MOCK_METHOD1(flowControl, void(int64_t));
88 MOCK_METHOD2(close, void(unsigned short, const WebString&)); 88 MOCK_METHOD2(close, void(unsigned short, const WebString&));
89 }; 89 };
90 90
91 class DocumentWebSocketChannelTest : public ::testing::Test { 91 class DocumentWebSocketChannelTest : public ::testing::Test {
92 public: 92 public:
93 DocumentWebSocketChannelTest() 93 DocumentWebSocketChannelTest()
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 EXPECT_CALL(*channelClient(), didError()); 681 EXPECT_CALL(*channelClient(), didError());
682 EXPECT_CALL(*channelClient(), didClose(WebSocketChannelClient::ClosingHa ndshakeIncomplete, WebSocketChannel::CloseEventCodeAbnormalClosure, String())); 682 EXPECT_CALL(*channelClient(), didClose(WebSocketChannelClient::ClosingHa ndshakeIncomplete, WebSocketChannel::CloseEventCodeAbnormalClosure, String()));
683 } 683 }
684 684
685 channel()->fail("fail message from WebSocket", ErrorMessageLevel, "sourceURL ", 1234); 685 channel()->fail("fail message from WebSocket", ErrorMessageLevel, "sourceURL ", 1234);
686 } 686 }
687 687
688 } // namespace 688 } // namespace
689 689
690 } // namespace blink 690 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/websockets/DocumentWebSocketChannel.cpp ('k') | Source/modules/websockets/WorkerWebSocketChannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698