OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef REMOTING_TEST_IT2ME_STANDALONE_HOST_H_ | |
6 #define REMOTING_TEST_IT2ME_STANDALONE_HOST_H_ | |
7 | |
8 #include <memory> | |
9 #include <string> | |
10 | |
11 #include "base/message_loop/message_loop.h" | |
12 #include "base/run_loop.h" | |
13 #include "base/timer/timer.h" | |
14 #include "remoting/host/host_mock_objects.h" | |
15 #include "remoting/host/it2me_desktop_environment.h" | |
16 #include "remoting/protocol/fake_connection_to_client.h" | |
17 #include "remoting/test/counter_stubs.h" | |
18 #include "testing/gmock/include/gmock/gmock.h" | |
19 | |
20 namespace remoting { | |
21 class ChromotingHostContext; | |
22 class ClientSession; | |
23 | |
24 namespace protocol { | |
25 class SessionConfig; | |
26 } // namespace protocl | |
27 | |
28 namespace test { | |
29 | |
30 // An container for an it2me host by using Counter*Stub(s) to do capturing | |
31 // without needing a client to connect to. | |
32 class It2MeStandaloneHost { | |
33 public: | |
34 It2MeStandaloneHost(); | |
35 ~It2MeStandaloneHost(); | |
36 | |
37 // Block current thread forever. | |
38 void Run(); | |
joedow
2016/05/04 16:40:45
Maybe call this RunHost() or StartHost()?
Hzj_jie
2016/05/04 19:18:04
Considering this class is called a Host, RunHost s
| |
39 | |
40 void StartToOutputToStdout(); | |
joedow
2016/05/04 16:40:45
Rename to 'StartOutputTimer()' ?
is there ever a
Hzj_jie
2016/05/04 19:18:04
I believe we may have a chance to start the host,
| |
41 | |
42 private: | |
43 // Must run in the same thread as | |
44 // It2MeDesktopEnvironmentFactory->caller_task_runner() | |
joedow
2016/05/04 16:40:45
I think you should either use a deterministic meth
Hzj_jie
2016/05/04 19:18:04
Seems I put this comment in a wrong position. I ha
| |
45 void Connect(); | |
46 | |
47 base::MessageLoopForUI message_loop_; | |
48 base::RunLoop run_loop_; | |
49 std::unique_ptr<ChromotingHostContext> context_; | |
50 It2MeDesktopEnvironmentFactory factory_; | |
51 protocol::FakeConnectionToClient connection_; | |
52 std::string session_jid_; | |
53 std::unique_ptr<protocol::SessionConfig> config_; | |
54 CounterStubs stubs_; | |
55 testing::NiceMock<MockClientSessionEventHandler> handler_; | |
56 std::unique_ptr<ClientSession> session_; | |
57 base::RepeatingTimer timer_; | |
joedow
2016/05/04 16:40:45
DISALLOW_COPY_AND_ASSIGN(...)
Hzj_jie
2016/05/04 19:18:04
I believe this class does not require to be not co
| |
58 }; | |
59 | |
60 } // namespace test | |
61 } // namespace remoting | |
62 | |
63 #endif // REMOTING_TEST_IT2ME_STANDALONE_HOST_H_ | |
OLD | NEW |