1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef REMOTING_PROTOCOL_MOCK_OBJECTS_H_
#define REMOTING_PROTOCOL_MOCK_OBJECTS_H_
#include "remoting/proto/internal.pb.h"
#include "remoting/protocol/connection_to_client.h"
#include "remoting/protocol/host_stub.h"
#include "remoting/protocol/input_stub.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace remoting {
namespace protocol {
class ChromotocolConnection;
class MockConnectionToClient : public ConnectionToClient {
public:
MockConnectionToClient() {}
MOCK_METHOD1(Init, void(ChromotocolConnection* connection));
MOCK_METHOD2(SendInitClientMessage, void(int width, int height));
MOCK_METHOD1(SendVideoPacket, void(const VideoPacket& packet));
MOCK_METHOD0(GetPendingUpdateStreamMessages, int());
MOCK_METHOD0(Disconnect, void());
private:
DISALLOW_COPY_AND_ASSIGN(MockConnectionToClient);
};
class MockConnectionToClientEventHandler :
public ConnectionToClient::EventHandler {
public:
MockConnectionToClientEventHandler() {}
MOCK_METHOD2(HandleMessage,
void(ConnectionToClient* viewer,
ChromotingClientMessage* message));
MOCK_METHOD1(OnConnectionOpened, void(ConnectionToClient* connection));
MOCK_METHOD1(OnConnectionClosed, void(ConnectionToClient* connection));
MOCK_METHOD1(OnConnectionFailed, void(ConnectionToClient* connection));
private:
DISALLOW_COPY_AND_ASSIGN(MockConnectionToClientEventHandler);
};
class MockInputStub : public InputStub {
public:
MockInputStub() {}
MOCK_METHOD2(InjectKeyEvent, void(const KeyEvent* event, Task* done));
MOCK_METHOD2(InjectMouseEvent, void(const MouseEvent* event, Task* done));
private:
DISALLOW_COPY_AND_ASSIGN(MockInputStub);
};
class MockHostStub : public HostStub {
public:
MockHostStub() {}
MOCK_METHOD2(SuggestResolution, void(const SuggestResolutionRequest* msg,
Task* done));
private:
DISALLOW_COPY_AND_ASSIGN(MockHostStub);
};
} // namespace protocol
} // namespace remoting
#endif // REMOTING_PROTOCOL_MOCK_OBJECTS_H_
|