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

Unified Diff: remoting/protocol/protocol_mock_objects.h

Issue 1460593005: Make protocol::ConnectionToClient an abstract interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: remoting/protocol/protocol_mock_objects.h
diff --git a/remoting/protocol/protocol_mock_objects.h b/remoting/protocol/protocol_mock_objects.h
index fcfa1205c058e9bcd8db0f89e810389dff455e77..5c1b1d5bc0acf19b8e8909e68d2030db32b51cfe 100644
--- a/remoting/protocol/protocol_mock_objects.h
+++ b/remoting/protocol/protocol_mock_objects.h
@@ -32,15 +32,22 @@ namespace protocol {
class MockConnectionToClient : public ConnectionToClient {
public:
- MockConnectionToClient(Session* session, HostStub* host_stub);
+ MockConnectionToClient(scoped_ptr<Session> session, HostStub* host_stub);
~MockConnectionToClient() override;
+ void SetEventHandler(EventHandler* event_handler) override {
+ event_handler_ = event_handler;
+ }
+
MOCK_METHOD1(Init, void(Session* session));
MOCK_METHOD0(video_stub, VideoStub*());
+ MOCK_METHOD0(audio_stub, AudioStub*());
MOCK_METHOD0(client_stub, ClientStub*());
- MOCK_METHOD0(session, Session*());
MOCK_METHOD1(Disconnect, void(ErrorCode error));
+ Session* session() override { return session_.get(); }
+ void OnInputEventReceived(int64_t timestamp) override {}
+
void set_clipboard_stub(ClipboardStub* clipboard_stub) override {
clipboard_stub_ = clipboard_stub;
}
@@ -54,16 +61,20 @@ class MockConnectionToClient : public ConnectionToClient {
video_feedback_stub_ = video_feedback_stub;
}
+ EventHandler* event_handler() { return event_handler_; }
ClipboardStub* clipboard_stub() { return clipboard_stub_; }
HostStub* host_stub() { return host_stub_; }
InputStub* input_stub() { return input_stub_; }
VideoFeedbackStub* video_feedback_stub() { return video_feedback_stub_; }
private:
- ClipboardStub* clipboard_stub_;
- HostStub* host_stub_;
- InputStub* input_stub_;
- VideoFeedbackStub* video_feedback_stub_;
+ scoped_ptr<Session> session_;
+ EventHandler* event_handler_ = nullptr;
+
+ ClipboardStub* clipboard_stub_ = nullptr;
+ HostStub* host_stub_ = nullptr;
+ InputStub* input_stub_ = nullptr;
+ VideoFeedbackStub* video_feedback_stub_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(MockConnectionToClient);
};

Powered by Google App Engine
This is Rietveld 408576698