OLD | NEW |
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" |
9 #include "remoting/protocol/connection_to_client.h" | 10 #include "remoting/protocol/connection_to_client.h" |
10 #include "remoting/protocol/host_stub.h" | 11 #include "remoting/protocol/host_stub.h" |
11 #include "remoting/protocol/input_stub.h" | 12 #include "remoting/protocol/input_stub.h" |
| 13 #include "remoting/protocol/session.h" |
12 #include "remoting/protocol/video_stub.h" | 14 #include "remoting/protocol/video_stub.h" |
13 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
14 | 16 |
15 namespace remoting { | 17 namespace remoting { |
16 namespace protocol { | 18 namespace protocol { |
17 | 19 |
18 class ChromotocolConnection; | 20 class ChromotocolConnection; |
19 | 21 |
20 class MockConnectionToClient : public ConnectionToClient { | 22 class MockConnectionToClient : public ConnectionToClient { |
21 public: | 23 public: |
22 MockConnectionToClient() {} | 24 MockConnectionToClient() {} |
23 | 25 |
24 MOCK_METHOD1(Init, void(ChromotocolConnection* connection)); | 26 MOCK_METHOD1(Init, void(Session* session)); |
25 MOCK_METHOD0(video_stub, VideoStub*()); | 27 MOCK_METHOD0(video_stub, VideoStub*()); |
| 28 MOCK_METHOD0(client_stub, ClientStub*()); |
| 29 MOCK_METHOD0(session, Session*()); |
26 MOCK_METHOD0(Disconnect, void()); | 30 MOCK_METHOD0(Disconnect, void()); |
27 | 31 |
28 private: | 32 private: |
29 DISALLOW_COPY_AND_ASSIGN(MockConnectionToClient); | 33 DISALLOW_COPY_AND_ASSIGN(MockConnectionToClient); |
30 }; | 34 }; |
31 | 35 |
32 class MockConnectionToClientEventHandler : | 36 class MockConnectionToClientEventHandler : |
33 public ConnectionToClient::EventHandler { | 37 public ConnectionToClient::EventHandler { |
34 public: | 38 public: |
35 MockConnectionToClientEventHandler() {} | 39 MockConnectionToClientEventHandler() {} |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 MockVideoStub() {} | 75 MockVideoStub() {} |
72 | 76 |
73 MOCK_METHOD2(ProcessVideoPacket, void(const VideoPacket* video_packet, | 77 MOCK_METHOD2(ProcessVideoPacket, void(const VideoPacket* video_packet, |
74 Task* done)); | 78 Task* done)); |
75 MOCK_METHOD0(GetPendingPackets, int()); | 79 MOCK_METHOD0(GetPendingPackets, int()); |
76 | 80 |
77 private: | 81 private: |
78 DISALLOW_COPY_AND_ASSIGN(MockVideoStub); | 82 DISALLOW_COPY_AND_ASSIGN(MockVideoStub); |
79 }; | 83 }; |
80 | 84 |
| 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 |
81 } // namespace protocol | 110 } // namespace protocol |
82 } // namespace remoting | 111 } // namespace remoting |
83 | 112 |
84 #endif // REMOTING_PROTOCOL_MOCK_OBJECTS_H_ | 113 #endif // REMOTING_PROTOCOL_MOCK_OBJECTS_H_ |
OLD | NEW |