blob: 4fa8b51f974745ed280f4146bdd3395aca3991bd [file] [log] [blame]
zijiehedd0b05c2016-05-05 18:44:151// 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#include "base/at_exit.h"
6#include "base/command_line.h"
7#include "base/logging.h"
8#include "remoting/host/resources.h"
9#include "remoting/proto/event.pb.h"
10#include "remoting/test/it2me_standalone_host.h"
11
12#if defined(OS_LINUX)
13#include <gtk/gtk.h>
zijiehedd0b05c2016-05-05 18:44:1514
15#include "base/linux_util.h"
Daniel Bratellb40fc332017-12-04 10:28:2116#include "ui/gfx/x/x11.h"
zijiehedd0b05c2016-05-05 18:44:1517#endif // defined(OS_LINUX)
18
19int main(int argc, const char** argv) {
20 base::AtExitManager at_exit_manager;
21 base::CommandLine::Init(argc, argv);
22 remoting::test::It2MeStandaloneHost host;
23
24#if defined(OS_LINUX)
25 // Required in order for us to run multiple X11 threads.
26 XInitThreads();
27
28 // Required for any calls into GTK functions, such as the Disconnect and
29 // Continue windows. Calling with nullptr arguments because we don't have
30 // any command line arguments for gtk to consume.
Tom Andersonafb06602018-08-23 23:13:0931#if GTK_CHECK_VERSION(3, 90, 0)
32 gtk_init();
33#else
zijiehedd0b05c2016-05-05 18:44:1534 gtk_init(nullptr, nullptr);
Tom Andersonafb06602018-08-23 23:13:0935#endif
zijiehedd0b05c2016-05-05 18:44:1536
37 // Need to prime the host OS version value for linux to prevent IO on the
38 // network thread. base::GetLinuxDistro() caches the result.
39 base::GetLinuxDistro();
40#endif // OS_LINUX
41 remoting::LoadResources("");
42 host.StartOutputTimer();
43 host.Run();
44}