Chromium Code Reviews| Index: remoting/test/it2me_standalone_host_main.cc |
| diff --git a/remoting/test/it2me_standalone_host_main.cc b/remoting/test/it2me_standalone_host_main.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9cc4cc357ea42af5b9fa085dbc840fcf49517b4c |
| --- /dev/null |
| +++ b/remoting/test/it2me_standalone_host_main.cc |
| @@ -0,0 +1,42 @@ |
| +// 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. |
| + |
| +#include "base/at_exit.h" |
| +#include "base/command_line.h" |
| +#include "base/logging.h" |
| +#include "remoting/host/resources.h" |
| +#include "remoting/proto/event.pb.h" |
| +#include "remoting/test/it2me_standalone_host.h" |
| + |
| +#if defined(OS_LINUX) |
| +#include <gtk/gtk.h> |
| +#include <X11/Xlib.h> |
| + |
| +#include "base/linux_util.h" |
| +#endif // defined(OS_LINUX) |
| + |
| +int main(int argc, const char** argv) { |
| + base::AtExitManager at_exit_manager; |
| + base::CommandLine::Init(argc, argv); |
| + remoting::test::It2MeStandaloneHost host; |
| + |
| +#if defined(OS_LINUX) |
| + // Required in order for us to run multiple X11 threads. |
| + XInitThreads(); |
| + |
| + // Required for any calls into GTK functions, such as the Disconnect and |
| + // Continue windows. Calling with nullptr arguments because we don't have |
| + // any command line arguments for gtk to consume. |
| + gtk_init(nullptr, nullptr); |
| + |
| + // Need to prime the host OS version value for linux to prevent IO on the |
| + // network thread. base::GetLinuxDistro() caches the result. |
| + base::GetLinuxDistro(); |
| + |
| + bool result = remoting::LoadResources("en-US"); |
|
joedow
2016/05/04 16:40:45
Do you only want to load resources on Linux? I'm
Hzj_jie
2016/05/04 19:18:04
I tried on Windows, the LoadResources failed. Look
joedow
2016/05/04 22:58:49
Based on discussion, can you move this?
Hzj_jie
2016/05/05 00:47:35
Done.
|
| + DCHECK(result); |
| +#endif // OS_LINUX |
| + host.StartToOutputToStdout(); |
| + host.Run(); |
| +} |