1# Copyright 2015 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
5import("//remoting/remoting_options.gni")
6
7static_library("test_support") {
8  testonly = true
9
10  sources = [
11    "cli_util.cc",
12    "cli_util.h",
13    "cyclic_frame_generator.cc",
14    "cyclic_frame_generator.h",
15    "fake_ice_connection.cc",
16    "fake_ice_connection.h",
17    "fake_network_dispatcher.cc",
18    "fake_network_dispatcher.h",
19    "fake_network_manager.cc",
20    "fake_network_manager.h",
21    "fake_port_allocator.cc",
22    "fake_port_allocator.h",
23    "fake_socket_factory.cc",
24    "fake_socket_factory.h",
25    "fake_test_token_storage.cc",
26    "fake_test_token_storage.h",
27    "fake_webrtc_connection.cc",
28    "fake_webrtc_connection.h",
29    "frame_generator_util.cc",
30    "frame_generator_util.h",
31    "remote_connection_observer.h",
32    "rgb_value.cc",
33    "rgb_value.h",
34    "scroll_frame_generator.cc",
35    "scroll_frame_generator.h",
36    "test_device_id_provider.cc",
37    "test_device_id_provider.h",
38    "test_oauth_token_getter.cc",
39    "test_oauth_token_getter.h",
40    "test_token_storage.cc",
41    "test_token_storage.h",
42    "video_frame_writer.cc",
43    "video_frame_writer.h",
44  ]
45
46  public_deps = [
47    "//base",
48    "//mojo/core/embedder",
49    "//net",
50    "//remoting/base",
51    "//remoting/client",
52    "//remoting/client/audio",
53    "//remoting/codec:decoder",
54    "//remoting/codec:encoder",
55    "//remoting/protocol",
56    "//remoting/signaling",
57    "//services/network:test_support",
58    "//third_party/webrtc_overrides:webrtc_component",
59    "//ui/gfx",
60  ]
61
62  deps = [
63    "//google_apis",
64    "//remoting/base:authorization",
65    "//remoting/base:test_support",
66    "//services/network:network_service",
67    "//services/network/public/mojom",
68    "//skia",
69    "//testing/gmock",
70    "//testing/gtest",
71    "//third_party/webrtc_overrides:webrtc_component",
72  ]
73}
74
75if (enable_remoting_host && !is_android && !is_chromeos) {
76  static_library("fake_connection_event_logger") {
77    testonly = true
78
79    sources = [
80      "fake_connection_event_logger.cc",
81      "fake_connection_event_logger.h",
82    ]
83
84    deps = [
85      "//remoting/host:common",
86      "//remoting/protocol:test_support",
87    ]
88  }
89
90  if (!is_win) {
91    # A binary for starting an IT2ME host from command line.
92    executable("it2me_cli_host") {
93      testonly = true
94      sources = [
95        "it2me_cli_host.cc",
96        "it2me_cli_host.h",
97        "it2me_cli_host_main.cc",
98      ]
99      deps = [
100        ":test_support",
101        "//mojo/core/embedder",
102        "//remoting/base",
103        "//remoting/host",
104        "//remoting/host/it2me:common",
105        "//remoting/host/native_messaging",
106      ]
107    }
108  }
109
110  static_library("it2me_standalone_host") {
111    testonly = true
112
113    sources = [
114      "it2me_standalone_host.cc",
115      "it2me_standalone_host.h",
116    ]
117
118    deps = [
119      ":fake_connection_event_logger",
120      "//base/test:test_support",
121      "//third_party/webrtc_overrides:webrtc_component",
122    ]
123
124    public_deps = [
125      "//remoting/host:test_support",
126      "//testing/gmock",
127    ]
128  }
129
130  executable("it2me_standalone_host_main") {
131    testonly = true
132    defines = []
133    libs = []
134
135    sources = [ "it2me_standalone_host_main.cc" ]
136
137    deps = [ ":it2me_standalone_host" ]
138
139    if (use_gtk) {
140      deps += [ "//build/config/linux/gtk" ]
141    }
142
143    if (is_win) {
144      defines += [ "_ALT_NO_EXCEPTIONS" ]
145      deps += [ "//remoting/host/win:dpi_aware_exe_manifest" ]
146      libs += [
147        "rpcrt4.lib",
148        "wtsapi32.lib",
149      ]
150    }
151  }
152
153  # A binary with a specific version of EvaluateCapabilityLocally() for test
154  # purpose only.
155  executable("capability_test_stub") {
156    testonly = true
157    sources = [ "capability_test_stub_main.cc" ]
158
159    deps = [ "//base" ]
160  }
161}
162
163# A binary for testing and fiddling FTL services.
164executable("ftl_services_playground") {
165  testonly = true
166  sources = [
167    "ftl_services_playground.cc",
168    "ftl_services_playground.h",
169    "ftl_services_playground_main.cc",
170  ]
171  deps = [
172    ":test_support",
173    "//mojo/core/embedder",
174    "//remoting/base",
175    "//remoting/signaling",
176  ]
177}
178
179# A binary for testing and fiddling the FTL signaling process.
180executable("ftl_signaling_playground") {
181  testonly = true
182  sources = [
183    "ftl_signaling_playground.cc",
184    "ftl_signaling_playground.h",
185    "ftl_signaling_playground_main.cc",
186  ]
187  deps = [
188    ":test_support",
189    "//mojo/core/embedder",
190    "//remoting/base",
191    "//remoting/signaling",
192  ]
193}
194