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

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

Issue 902613004: Fix ConnectionToClient to connect stubs only after authentication. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audio_pump
Patch Set: Created 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PROTOCOL_MOCK_OBJECTS_H_ 5 #ifndef REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_
6 #define REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_ 6 #define REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 24 matching lines...) Expand all
35 MockConnectionToClient(Session* session, 35 MockConnectionToClient(Session* session,
36 HostStub* host_stub); 36 HostStub* host_stub);
37 virtual ~MockConnectionToClient(); 37 virtual ~MockConnectionToClient();
38 38
39 MOCK_METHOD1(Init, void(Session* session)); 39 MOCK_METHOD1(Init, void(Session* session));
40 MOCK_METHOD0(video_stub, VideoStub*()); 40 MOCK_METHOD0(video_stub, VideoStub*());
41 MOCK_METHOD0(client_stub, ClientStub*()); 41 MOCK_METHOD0(client_stub, ClientStub*());
42 MOCK_METHOD0(session, Session*()); 42 MOCK_METHOD0(session, Session*());
43 MOCK_METHOD0(Disconnect, void()); 43 MOCK_METHOD0(Disconnect, void());
44 44
45 void set_clipboard_stub(ClipboardStub* clipboard_stub) override {
46 clipboard_stub_ = clipboard_stub;
47 }
48 void set_host_stub(HostStub* host_stub) override { host_stub_ = host_stub; }
49 void set_input_stub(InputStub* input_stub) override {
50 input_stub_ = input_stub;
51 }
52
53 ClipboardStub* clipboard_stub() { return clipboard_stub_; }
54 HostStub* host_stub() { return host_stub_; }
55 InputStub* input_stub() { return input_stub_; }
56
45 private: 57 private:
58 ClipboardStub* clipboard_stub_;
59 HostStub* host_stub_;
60 InputStub* input_stub_;
61
46 DISALLOW_COPY_AND_ASSIGN(MockConnectionToClient); 62 DISALLOW_COPY_AND_ASSIGN(MockConnectionToClient);
47 }; 63 };
48 64
49 class MockConnectionToClientEventHandler : 65 class MockConnectionToClientEventHandler :
50 public ConnectionToClient::EventHandler { 66 public ConnectionToClient::EventHandler {
51 public: 67 public:
52 MockConnectionToClientEventHandler(); 68 MockConnectionToClientEventHandler();
53 virtual ~MockConnectionToClientEventHandler(); 69 virtual ~MockConnectionToClientEventHandler();
54 70
55 MOCK_METHOD1(OnConnectionAuthenticating, 71 MOCK_METHOD1(OnConnectionAuthenticating,
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // Runs tasks synchronously instead of posting them to |task_runner|. 270 // Runs tasks synchronously instead of posting them to |task_runner|.
255 void PostTask(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, 271 void PostTask(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
256 const tracked_objects::Location& from_here, 272 const tracked_objects::Location& from_here,
257 const base::Closure& task) override; 273 const base::Closure& task) override;
258 }; 274 };
259 275
260 } // namespace protocol 276 } // namespace protocol
261 } // namespace remoting 277 } // namespace remoting
262 278
263 #endif // REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_ 279 #endif // REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_
OLDNEW
« no previous file with comments | « remoting/protocol/connection_to_client_unittest.cc ('k') | remoting/protocol/protocol_mock_objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698