Chromium Code Reviews| Index: remoting/test/it2me_standalone_host.h |
| diff --git a/remoting/test/it2me_standalone_host.h b/remoting/test/it2me_standalone_host.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..053ed6892231832e87b447e7aa258dfb17ee83c5 |
| --- /dev/null |
| +++ b/remoting/test/it2me_standalone_host.h |
| @@ -0,0 +1,63 @@ |
| +// Copyright 2016 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_TEST_IT2ME_STANDALONE_HOST_H_ |
| +#define REMOTING_TEST_IT2ME_STANDALONE_HOST_H_ |
| + |
| +#include <memory> |
| +#include <string> |
| + |
| +#include "base/message_loop/message_loop.h" |
| +#include "base/run_loop.h" |
| +#include "base/timer/timer.h" |
| +#include "remoting/host/host_mock_objects.h" |
| +#include "remoting/host/it2me_desktop_environment.h" |
| +#include "remoting/protocol/fake_connection_to_client.h" |
| +#include "remoting/test/counter_stubs.h" |
| +#include "testing/gmock/include/gmock/gmock.h" |
| + |
| +namespace remoting { |
| +class ChromotingHostContext; |
| +class ClientSession; |
| + |
| +namespace protocol { |
| +class SessionConfig; |
| +} // namespace protocl |
| + |
| +namespace test { |
| + |
| +// An container for an it2me host by using Counter*Stub(s) to do capturing |
| +// without needing a client to connect to. |
| +class It2MeStandaloneHost { |
| + public: |
| + It2MeStandaloneHost(); |
| + ~It2MeStandaloneHost(); |
| + |
| + // Block current thread forever. |
| + 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
|
| + |
| + 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,
|
| + |
| + private: |
| + // Must run in the same thread as |
| + // 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
|
| + void Connect(); |
| + |
| + base::MessageLoopForUI message_loop_; |
| + base::RunLoop run_loop_; |
| + std::unique_ptr<ChromotingHostContext> context_; |
| + It2MeDesktopEnvironmentFactory factory_; |
| + protocol::FakeConnectionToClient connection_; |
| + std::string session_jid_; |
| + std::unique_ptr<protocol::SessionConfig> config_; |
| + CounterStubs stubs_; |
| + testing::NiceMock<MockClientSessionEventHandler> handler_; |
| + std::unique_ptr<ClientSession> session_; |
| + 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
|
| +}; |
| + |
| +} // namespace test |
| +} // namespace remoting |
| + |
| +#endif // REMOTING_TEST_IT2ME_STANDALONE_HOST_H_ |