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

Side by Side Diff: remoting/protocol/mock_objects.h

Issue 6266023: Revert "Fix crashes in ChromotingHost" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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
« no previous file with comments | « remoting/protocol/connection_to_client.h ('k') | remoting/remoting.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef REMOTING_PROTOCOL_MOCK_OBJECTS_H_ 5 #ifndef REMOTING_PROTOCOL_MOCK_OBJECTS_H_
6 #define REMOTING_PROTOCOL_MOCK_OBJECTS_H_ 6 #define REMOTING_PROTOCOL_MOCK_OBJECTS_H_
7 7
8 #include "remoting/proto/internal.pb.h" 8 #include "remoting/proto/internal.pb.h"
9 #include "remoting/protocol/client_stub.h"
10 #include "remoting/protocol/connection_to_client.h" 9 #include "remoting/protocol/connection_to_client.h"
11 #include "remoting/protocol/host_stub.h" 10 #include "remoting/protocol/host_stub.h"
12 #include "remoting/protocol/input_stub.h" 11 #include "remoting/protocol/input_stub.h"
13 #include "remoting/protocol/session.h"
14 #include "remoting/protocol/video_stub.h" 12 #include "remoting/protocol/video_stub.h"
15 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
16 14
17 namespace remoting { 15 namespace remoting {
18 namespace protocol { 16 namespace protocol {
19 17
20 class ChromotocolConnection; 18 class ChromotocolConnection;
21 19
22 class MockConnectionToClient : public ConnectionToClient { 20 class MockConnectionToClient : public ConnectionToClient {
23 public: 21 public:
24 MockConnectionToClient() {} 22 MockConnectionToClient() {}
25 23
26 MOCK_METHOD1(Init, void(Session* session)); 24 MOCK_METHOD1(Init, void(ChromotocolConnection* connection));
27 MOCK_METHOD0(video_stub, VideoStub*()); 25 MOCK_METHOD0(video_stub, VideoStub*());
28 MOCK_METHOD0(client_stub, ClientStub*());
29 MOCK_METHOD0(session, Session*());
30 MOCK_METHOD0(Disconnect, void()); 26 MOCK_METHOD0(Disconnect, void());
31 27
32 private: 28 private:
33 DISALLOW_COPY_AND_ASSIGN(MockConnectionToClient); 29 DISALLOW_COPY_AND_ASSIGN(MockConnectionToClient);
34 }; 30 };
35 31
36 class MockConnectionToClientEventHandler : 32 class MockConnectionToClientEventHandler :
37 public ConnectionToClient::EventHandler { 33 public ConnectionToClient::EventHandler {
38 public: 34 public:
39 MockConnectionToClientEventHandler() {} 35 MockConnectionToClientEventHandler() {}
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 MockVideoStub() {} 71 MockVideoStub() {}
76 72
77 MOCK_METHOD2(ProcessVideoPacket, void(const VideoPacket* video_packet, 73 MOCK_METHOD2(ProcessVideoPacket, void(const VideoPacket* video_packet,
78 Task* done)); 74 Task* done));
79 MOCK_METHOD0(GetPendingPackets, int()); 75 MOCK_METHOD0(GetPendingPackets, int());
80 76
81 private: 77 private:
82 DISALLOW_COPY_AND_ASSIGN(MockVideoStub); 78 DISALLOW_COPY_AND_ASSIGN(MockVideoStub);
83 }; 79 };
84 80
85 class MockSession : public Session {
86 public:
87 MockSession() {}
88
89 MOCK_METHOD1(SetStateChangeCallback, void(StateChangeCallback* callback));
90 MOCK_METHOD0(control_channel, net::Socket*());
91 MOCK_METHOD0(event_channel, net::Socket*());
92 MOCK_METHOD0(video_channel, net::Socket*());
93 MOCK_METHOD0(video_rtp_channel, net::Socket*());
94 MOCK_METHOD0(video_rtcp_channel, net::Socket*());
95 MOCK_METHOD0(jid, const std::string&());
96 MOCK_METHOD0(message_loop, MessageLoop*());
97 MOCK_METHOD0(candidate_config, const CandidateSessionConfig*());
98 MOCK_METHOD0(config, const SessionConfig*());
99 MOCK_METHOD1(set_config, void(const SessionConfig* config));
100 MOCK_METHOD0(initiator_token, const std::string&());
101 MOCK_METHOD1(set_initiator_token, void(const std::string& initiator_token));
102 MOCK_METHOD0(receiver_token, const std::string&());
103 MOCK_METHOD1(set_receiver_token, void(const std::string& receiver_token));
104 MOCK_METHOD1(Close, void(Task* closed_task));
105
106 private:
107 DISALLOW_COPY_AND_ASSIGN(MockSession);
108 };
109
110 } // namespace protocol 81 } // namespace protocol
111 } // namespace remoting 82 } // namespace remoting
112 83
113 #endif // REMOTING_PROTOCOL_MOCK_OBJECTS_H_ 84 #endif // REMOTING_PROTOCOL_MOCK_OBJECTS_H_
OLDNEW
« no previous file with comments | « remoting/protocol/connection_to_client.h ('k') | remoting/remoting.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698