Re-land: C++ readability review
[chromium-blink-merge.git] / remoting / BUILD.gn
blob70aafa01157bd26389fa194f1b24ebccf9c8bca7
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.
5 import("//build/config/features.gni")
6 import("//build/config/ui.gni")
7 import("//remoting/remoting_version.gni")
8 import("//remoting/remoting_host.gni")
9 import("//testing/test.gni")
11 # Various remoting targets need this version definition.
12 config("version") {
13   defines = [ "VERSION=$version_full" ]
16 # GYP version: remoting/remoting_test.gypi:remoting_test_common
17 source_set("test_support") {
18   testonly = true
20   sources = [
21     # Files from remoting_test_common not in separate test_support targets.
22     "signaling/fake_signal_strategy.cc",
23     "signaling/fake_signal_strategy.h",
24     "signaling/mock_signal_strategy.cc",
25     "signaling/mock_signal_strategy.h",
26     "test/access_token_fetcher.cc",
27     "test/access_token_fetcher.h",
28     "test/app_remoting_test_driver_environment.cc",
29     "test/app_remoting_test_driver_environment.h",
30     "test/app_remoting_test_driver_environment_app_details.cc",
31     "test/fake_access_token_fetcher.cc",
32     "test/fake_access_token_fetcher.h",
33     "test/fake_network_dispatcher.cc",
34     "test/fake_network_dispatcher.h",
35     "test/fake_network_manager.cc",
36     "test/fake_network_manager.h",
37     "test/fake_port_allocator.cc",
38     "test/fake_port_allocator.h",
39     "test/fake_remote_host_info_fetcher.cc",
40     "test/fake_remote_host_info_fetcher.h",
41     "test/fake_socket_factory.cc",
42     "test/fake_socket_factory.h",
43     "test/leaky_bucket.cc",
44     "test/leaky_bucket.h",
45     "test/mock_access_token_fetcher.cc",
46     "test/mock_access_token_fetcher.h",
47     "test/refresh_token_store.cc",
48     "test/refresh_token_store.h",
49     "test/remote_application_details.h",
50     "test/remote_connection_observer.h",
51     "test/remote_host_info.cc",
52     "test/remote_host_info.h",
53     "test/remote_host_info_fetcher.cc",
54     "test/remote_host_info_fetcher.h",
55     "test/test_chromoting_client.cc",
56     "test/test_chromoting_client.h",
57     "test/test_video_renderer.cc",
58     "test/test_video_renderer.h",
59   ]
61   deps = [
62     "//base",
63     "//net",
64     "//remoting/base",
65     "//remoting/client",
66     "//remoting/codec",
67     "//remoting/protocol:test_support",
68     "//remoting/resources",
69     "//testing/gmock",
70     "//testing/gtest",
71   ]
73   if (enable_configuration_policy) {
74     deps += [ "//components/policy:test_support" ]
75   }
77   if (enable_remoting_host) {
78     deps += [ "//remoting/host:test_support" ]
79   }
82 # TODO(GYP) remoting_unittests on Mac/Windows. Currently this fails with a
83 # duplicate resource error on linking on Windows. Just needs to be checked on
84 # Mac.
85 if (!is_win && !is_mac) {
86   test("remoting_unittests") {
87     # Sources not included in one of the more specific unit_tests deps.
88     sources = [
89       "signaling/iq_sender_unittest.cc",
90       "signaling/log_to_server_unittest.cc",
91       "signaling/server_log_entry_unittest.cc",
92       "signaling/server_log_entry_unittest.h",
93       "test/access_token_fetcher_unittest.cc",
94       "test/app_remoting_test_driver_environment_unittest.cc",
95       "test/remote_host_info_fetcher_unittest.cc",
96       "test/test_chromoting_client_unittest.cc",
97     ]
99     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
100     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
102     deps = [
103       ":test_support",
104       "//base/allocator",
105       "//google_apis",
106       "//remoting/base:unit_tests",
107       "//remoting/client:unit_tests",
108       "//remoting/protocol:test_support",
109       "//remoting/protocol:unit_tests",
110       "//testing/gmock",
111       "//testing/gtest",
112       "//third_party/webrtc",
113     ]
115     if (is_android) {
116       deps += [ "//testing/android:native_test_native_code" ]
117     } else {
118       deps += [
119         "//remoting/client/plugin",
120         "//remoting/client/plugin:unit_tests",
121       ]
122     }
124     if (enable_remoting_host) {
125       deps += [
126         "//remoting/codec:unit_tests",
127         "//remoting/host:unit_tests",
128       ]
129     }
131     if (enable_webrtc) {
132       deps += [
133         "//third_party/libjingle:libjingle_webrtc",
134         "//third_party/libjingle:libpeerconnection",
135       ]
136     }
137   }
139   if (enable_remoting_host) {
140     test("remoting_perftests") {
141       sources = [
142         "codec/codec_test.cc",
143         "codec/codec_test.h",
144         "codec/video_encoder_vpx_perftest.cc",
145         "test/protocol_perftest.cc",
146       ]
148       configs += [ ":version" ]
150       deps = [
151         ":test_support",
152         "//base",
153         "//base/test:run_all_unittests",
154         "//base/test:test_support",
155         "//net:test_support",
156         "//remoting/base",
157         "//testing/gtest",
158         "//third_party/webrtc/modules/desktop_capture",
159         "//third_party/libjingle",
160       ]
162       if (enable_webrtc) {
163         deps += [ "//third_party/libjingle:libjingle_webrtc" ]
164       }
165     }
166   }
167 } else {
168   group("remoting_unittests") {
169   }
172 if (enable_pnacl) {
173   group("remoting_key_tester") {
174     deps = [
175       ":remoting_key_tester_copies",
176     ]
177   }
179   copy("remoting_key_tester_copies") {
180     sources = [
181       "tools/javascript_key_tester/background.js",
182       "tools/javascript_key_tester/chord_tracker.js",
183       "tools/javascript_key_tester/event_listeners.js",
184       "tools/javascript_key_tester/icon_128.png",
185       "tools/javascript_key_tester/main.css",
186       "tools/javascript_key_tester/main.html",
187       "tools/javascript_key_tester/main.js",
188       "tools/javascript_key_tester/manifest.json",
189       "tools/javascript_key_tester/pnacl/remoting_key_tester.nmf",
191       # TODO(GYP): crbug.com/471924 "$target_out_dir/remoting_key_tester_newlib.pexe",
192     ]
194     outputs = [
195       "$target_out_dir/remoting/key_tester/{{source_file_part}}",
196     ]
198     deps = [
199       ":remoting_key_tester_jscompile",
200       ":remoting_key_tester_pexe",
201     ]
202   }
204   group("remoting_key_tester_jscompile") {
205     # TODO(GYP): crbug.com/471926 add support for run_jscompile=true.
206     run_jscompile = false
207     if (run_jscompile) {
208     }
209   }
211   group("remoting_key_tester_pexe") {
212     # TODO(GYP): crbug.com/471924 implement me when we have a pnacl toolchain.
213     #sources = [
214     # "tools/javascript_key_tester/pnacl/remoting_key_tester.cc",
215     #]
216   }