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

Unified Diff: remoting/test/it2me_standalone_host.h

Issue 1923573006: Implement a dummy host to do capturing and analysis only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve review commnets Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/test/fake_connection_event_logger.cc ('k') | remoting/test/it2me_standalone_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c7055374dbadebdc3722323081e58b46f1deb664
--- /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/memory/ref_counted.h"
+#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/fake_connection_event_logger.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace remoting {
+class ChromotingHostContext;
+class ClientSession;
+
+namespace protocol {
+class SessionConfig;
+} // namespace protocol
+
+namespace test {
+
+// A container for an it2me host by using FakeConnectionEventLogger to do
+// capturing without needing a client to connect to.
+class It2MeStandaloneHost {
+ public:
+ It2MeStandaloneHost();
+ ~It2MeStandaloneHost();
+
+ // Block current thread forever.
+ void Run();
+
+ void StartOutputTimer();
+
+ private:
+ void Connect();
+
+ base::MessageLoopForUI message_loop_;
+ base::RunLoop run_loop_;
+ std::unique_ptr<ChromotingHostContext> context_;
+ scoped_refptr<AutoThreadTaskRunner> main_task_runner_;
+ It2MeDesktopEnvironmentFactory factory_;
+ protocol::FakeConnectionToClient connection_;
+ std::string session_jid_;
+ std::unique_ptr<protocol::SessionConfig> config_;
+ FakeConnectionEventLogger event_logger_;
+ testing::NiceMock<MockClientSessionEventHandler> handler_;
+ std::unique_ptr<ClientSession> session_;
+ base::RepeatingTimer timer_;
+};
+
+} // namespace test
+} // namespace remoting
+
+#endif // REMOTING_TEST_IT2ME_STANDALONE_HOST_H_
« no previous file with comments | « remoting/test/fake_connection_event_logger.cc ('k') | remoting/test/it2me_standalone_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698