[go: nahoru, domu]

blob: cf28f25b06b9d1c548340e8e9d5ed5f2c297b2f7 [file] [log] [blame]
brettw@chromium.org240e3032014-05-27 20:15:201# Copyright 2014 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
slan074ec342016-01-29 23:52:265import("//build/config/features.gni")
brettw9d6a868b2016-08-30 05:52:066import("//build/config/nacl/config.gni")
7import("//build/config/nacl/rules.gni")
Dirk Prankeccc0c362017-09-28 22:15:118import("//components/nacl/features.gni")
brettw4b461082016-11-19 18:55:169import("//ppapi/features/features.gni")
brettw9d6a868b2016-08-30 05:52:0610import("//testing/test.gni")
11if (is_mac) {
12 import("//build/config/mac/rules.gni")
13}
slan074ec342016-01-29 23:52:2614
agrievee786dac2015-12-02 14:45:2215assert(!is_android || enable_plugins,
16 "//ppapi should not be referenced when is_android && !enable_plugins")
17
brettw9d6a868b2016-08-30 05:52:0618# Test files shared between several targets below.
19#
20# TODO(brettw) it seems like it should be possible to factor this in a source
21# set that is shared in such a way that these only need to be referenced once.
22test_common_source_files = [
23 "lib/gl/gles2/gl2ext_ppapi.c",
24 "lib/gl/gles2/gl2ext_ppapi.h",
25 "lib/gl/gles2/gles2.c",
26 "tests/all_c_includes.h",
27 "tests/all_cpp_includes.h",
28 "tests/arch_dependent_sizes_32.h",
29 "tests/arch_dependent_sizes_64.h",
30 "tests/pp_thread.h",
31 "tests/test_audio.cc",
32 "tests/test_audio.h",
33 "tests/test_audio_config.cc",
34 "tests/test_audio_config.h",
35 "tests/test_audio_encoder.cc",
36 "tests/test_audio_encoder.h",
37 "tests/test_case.cc",
38 "tests/test_case.h",
39 "tests/test_compositor.cc",
40 "tests/test_compositor.h",
41 "tests/test_console.cc",
42 "tests/test_console.h",
43 "tests/test_core.cc",
44 "tests/test_core.h",
45 "tests/test_cursor_control.cc",
46 "tests/test_cursor_control.h",
47 "tests/test_empty.cc",
48 "tests/test_empty.h",
49 "tests/test_file_io.cc",
50 "tests/test_file_io.h",
51 "tests/test_file_ref.cc",
52 "tests/test_file_ref.h",
53 "tests/test_file_system.cc",
54 "tests/test_file_system.h",
55 "tests/test_fullscreen.cc",
56 "tests/test_fullscreen.h",
57 "tests/test_graphics_2d.cc",
58 "tests/test_graphics_2d.h",
59 "tests/test_graphics_3d.cc",
60 "tests/test_graphics_3d.h",
61 "tests/test_host_resolver.cc",
62 "tests/test_host_resolver.h",
63 "tests/test_host_resolver_private.cc",
64 "tests/test_host_resolver_private.h",
65 "tests/test_host_resolver_private_disallowed.cc",
66 "tests/test_host_resolver_private_disallowed.h",
67 "tests/test_image_data.cc",
68 "tests/test_image_data.h",
69 "tests/test_ime_input_event.cc",
70 "tests/test_ime_input_event.h",
71 "tests/test_input_event.cc",
72 "tests/test_input_event.h",
73 "tests/test_media_stream_audio_track.cc",
74 "tests/test_media_stream_audio_track.h",
75 "tests/test_media_stream_video_track.cc",
76 "tests/test_media_stream_video_track.h",
77 "tests/test_memory.cc",
78 "tests/test_memory.h",
79 "tests/test_message_handler.cc",
80 "tests/test_message_handler.h",
81 "tests/test_message_loop.cc",
82 "tests/test_message_loop.h",
83 "tests/test_mouse_cursor.cc",
84 "tests/test_mouse_cursor.h",
85 "tests/test_mouse_lock.cc",
86 "tests/test_mouse_lock.h",
87 "tests/test_net_address.cc",
88 "tests/test_net_address.h",
89 "tests/test_net_address_private_untrusted.cc",
90 "tests/test_net_address_private_untrusted.h",
91 "tests/test_network_monitor.cc",
92 "tests/test_network_monitor.h",
93 "tests/test_network_proxy.cc",
94 "tests/test_network_proxy.h",
95 "tests/test_output_protection_private.cc",
96 "tests/test_output_protection_private.h",
97 "tests/test_paint_aggregator.cc",
98 "tests/test_paint_aggregator.h",
99 "tests/test_post_message.cc",
100 "tests/test_post_message.h",
101 "tests/test_printing.cc",
102 "tests/test_printing.h",
103 "tests/test_tcp_server_socket_private.cc",
104 "tests/test_tcp_server_socket_private.h",
105 "tests/test_tcp_socket.cc",
106 "tests/test_tcp_socket.h",
107 "tests/test_tcp_socket_private.cc",
108 "tests/test_tcp_socket_private.h",
109 "tests/test_test_internals.cc",
110 "tests/test_test_internals.h",
111 "tests/test_trace_event.cc",
112 "tests/test_trace_event.h",
113 "tests/test_truetype_font.cc",
114 "tests/test_truetype_font.h",
115 "tests/test_udp_socket.cc",
116 "tests/test_udp_socket.h",
117 "tests/test_udp_socket_private.cc",
118 "tests/test_udp_socket_private.h",
119 "tests/test_uma.cc",
120 "tests/test_uma.h",
121 "tests/test_url_loader.cc",
122 "tests/test_url_loader.h",
123 "tests/test_url_request.cc",
124 "tests/test_url_request.h",
125 "tests/test_utils.cc",
126 "tests/test_var.cc",
127 "tests/test_var.h",
128 "tests/test_var_resource.cc",
129 "tests/test_var_resource.h",
130 "tests/test_video_decoder.cc",
131 "tests/test_video_decoder.h",
132 "tests/test_video_destination.cc",
133 "tests/test_video_destination.h",
134 "tests/test_video_encoder.cc",
135 "tests/test_video_encoder.h",
136 "tests/test_video_source.cc",
137 "tests/test_video_source.h",
138 "tests/test_view.cc",
139 "tests/test_view.h",
140 "tests/test_websocket.cc",
141 "tests/test_websocket.h",
142 "tests/testing_instance.cc",
143 "tests/testing_instance.h",
144
145 # Compile-time tests
146 "tests/test_c_includes.c",
147 "tests/test_cpp_includes.cc",
148 "tests/test_struct_sizes.c",
149]
rsesek53dc3102016-04-18 18:48:42150
jamb533b7e2015-03-04 17:12:05151copy("copy_test_files") {
152 visibility = [ ":*" ]
153 sources = [
154 # Keep "test_case.html.mock-http-headers" with "test_case.html".
155 "tests/test_case.html",
156 "tests/test_case.html.mock-http-headers",
157 "tests/test_page.css",
mkwstb28d5ba2015-05-12 05:47:51158 "tests/test_page.css.mock-http-headers",
jamb533b7e2015-03-04 17:12:05159 ]
160 outputs = [
161 "$root_out_dir/{{source_file_part}}",
162 ]
163}
164
165copy("copy_test_files2") {
166 visibility = [ ":*" ]
167 sources = [
168 "tests/test_url_loader_data/hello.txt",
169 ]
170 outputs = [
171 "$root_out_dir/test_url_loader_data/{{source_file_part}}",
172 ]
173}
174
rsesek4a735572016-04-20 00:18:24175source_set("ppapi_tests_sources") {
brettw9d6a868b2016-08-30 05:52:06176 sources = test_common_source_files
177 sources += [
178 "tests/test_broker.cc",
179 "tests/test_broker.h",
180 "tests/test_browser_font.cc",
181 "tests/test_browser_font.h",
182 "tests/test_buffer.cc",
183 "tests/test_buffer.h",
184 "tests/test_char_set.cc",
185 "tests/test_char_set.h",
186 "tests/test_crypto.cc",
187 "tests/test_crypto.h",
188 "tests/test_file_chooser.cc",
189 "tests/test_file_chooser.h",
190 "tests/test_flash.cc",
191 "tests/test_flash.h",
192 "tests/test_flash_clipboard.cc",
193 "tests/test_flash_clipboard.h",
194 "tests/test_flash_drm.cc",
195 "tests/test_flash_drm.h",
196 "tests/test_flash_file.cc",
197 "tests/test_flash_file.h",
198 "tests/test_flash_fullscreen.cc",
199 "tests/test_flash_fullscreen.h",
200 "tests/test_flash_fullscreen_for_browser_ui.cc",
201 "tests/test_flash_fullscreen_for_browser_ui.h",
202 "tests/test_flash_message_loop.cc",
203 "tests/test_flash_message_loop.h",
204 "tests/test_net_address_private.cc",
205 "tests/test_net_address_private.h",
206 "tests/test_pdf.cc",
207 "tests/test_pdf.h",
208 "tests/test_platform_verification_private.cc",
209 "tests/test_platform_verification_private.h",
210 "tests/test_tcp_socket_private_trusted.cc",
211 "tests/test_tcp_socket_private_trusted.h",
212 "tests/test_url_util.cc",
213 "tests/test_url_util.h",
214 "tests/test_utils.h",
215 "tests/test_video_decoder_dev.cc",
216 "tests/test_video_decoder_dev.h",
217 "tests/test_x509_certificate_private.cc",
218 "tests/test_x509_certificate_private.h",
219
220 # Deprecated test cases.
221 "tests/test_instance_deprecated.cc",
222 "tests/test_instance_deprecated.h",
223 "tests/test_var_deprecated.cc",
224 "tests/test_var_deprecated.h",
225 ]
jamb3dd04982015-02-25 18:22:56226
dprankea22b0732015-10-21 21:15:11227 configs += [
228 "//build/config:precompiled_headers",
229 "//v8:external_startup_data",
230 ]
231
jamb3dd04982015-02-25 18:22:56232 defines = [ "GL_GLEXT_PROTOTYPES" ]
233 include_dirs = [ "lib/gl/include" ]
234
235 deps = [
jamb533b7e2015-03-04 17:12:05236 ":copy_test_files",
237 ":copy_test_files2",
thomasanderson84fa8b02017-05-18 23:38:47238 "//build/config:exe_and_shlib_deps",
brettwba7a73d2015-08-31 22:17:39239 "//ppapi/cpp",
240 "//ppapi/shared_impl",
jamb3dd04982015-02-25 18:22:56241 ]
242}
brettw31f4de692015-03-04 17:24:45243
brettw9d6a868b2016-08-30 05:52:06244if (is_mac) {
245 ppapi_tests_target_type = "mac_plugin_bundle"
rsesek4a735572016-04-20 00:18:24246} else {
brettw9d6a868b2016-08-30 05:52:06247 ppapi_tests_target_type = "shared_library"
248}
249target(ppapi_tests_target_type, "ppapi_tests") {
250 deps = [
251 ":ppapi_tests_sources",
252 ]
rsesek4a735572016-04-20 00:18:24253}
254
255source_set("power_saver_test_plugin_sources") {
tommycli0dd13012015-04-24 20:27:22256 sources = [
257 "tests/power_saver_test_plugin.cc",
258 "tests/test_utils.cc",
259 ]
260
261 deps = [
thomasanderson84fa8b02017-05-18 23:38:47262 "//build/config:exe_and_shlib_deps",
tommycli0dd13012015-04-24 20:27:22263 "//ppapi/cpp",
264 "//ppapi/shared_impl",
265 ]
266}
267
rsesek4a735572016-04-20 00:18:24268if (!is_mac) {
269 shared_library("power_saver_test_plugin") {
270 deps = [
271 ":power_saver_test_plugin_sources",
272 ]
273 }
274} else {
275 mac_plugin_bundle("power_saver_test_plugin") {
276 deps = [
277 ":power_saver_test_plugin_sources",
278 ]
279 }
280}
281
rsesek53dc3102016-04-18 18:48:42282source_set("blink_deprecated_test_plugin_sources") {
dchengc70b36e2016-03-02 02:36:10283 sources = [
284 "tests/blink_deprecated_test_plugin.cc",
285 ]
286
287 deps = [
288 "//base",
thomasanderson84fa8b02017-05-18 23:38:47289 "//build/config:exe_and_shlib_deps",
dchengc70b36e2016-03-02 02:36:10290 "//ppapi/cpp",
291 "//ppapi/shared_impl",
292 ]
293}
294
rsesek53dc3102016-04-18 18:48:42295if (!is_mac) {
296 loadable_module("blink_deprecated_test_plugin") {
297 deps = [
298 ":blink_deprecated_test_plugin_sources",
299 ]
300 }
301} else {
302 mac_plugin_bundle("blink_deprecated_test_plugin") {
303 deps = [
304 ":blink_deprecated_test_plugin_sources",
305 ]
306 }
307}
308
309source_set("blink_test_plugin_sources") {
dcheng0d93c1a2015-12-03 02:46:41310 sources = [
311 "tests/blink_test_plugin.cc",
312 ]
313
314 deps = [
dchengad959102016-03-02 05:23:13315 "//base",
thomasanderson84fa8b02017-05-18 23:38:47316 "//build/config:exe_and_shlib_deps",
dcheng0d93c1a2015-12-03 02:46:41317 "//ppapi/cpp",
318 "//ppapi/shared_impl",
319 ]
320}
321
rsesek53dc3102016-04-18 18:48:42322if (!is_mac) {
323 loadable_module("blink_test_plugin") {
324 deps = [
325 ":blink_test_plugin_sources",
326 ]
327 }
328} else {
329 mac_plugin_bundle("blink_test_plugin") {
330 deps = [
331 ":blink_test_plugin_sources",
332 ]
333 }
334}
335
brettw31f4de692015-03-04 17:24:45336test("ppapi_unittests") {
337 sources = [
338 "host/resource_message_filter_unittest.cc",
339 "proxy/device_enumeration_resource_helper_unittest.cc",
340 "proxy/file_chooser_resource_unittest.cc",
341 "proxy/file_system_resource_unittest.cc",
342 "proxy/flash_resource_unittest.cc",
343 "proxy/interface_list_unittest.cc",
344 "proxy/mock_resource.cc",
345 "proxy/mock_resource.h",
346 "proxy/nacl_message_scanner_unittest.cc",
347 "proxy/pdf_resource_unittest.cc",
348 "proxy/plugin_dispatcher_unittest.cc",
349 "proxy/plugin_resource_tracker_unittest.cc",
350 "proxy/plugin_var_tracker_unittest.cc",
351 "proxy/ppb_var_unittest.cc",
352 "proxy/ppp_instance_private_proxy_unittest.cc",
353 "proxy/ppp_instance_proxy_unittest.cc",
354 "proxy/ppp_messaging_proxy_unittest.cc",
355 "proxy/printing_resource_unittest.cc",
356 "proxy/raw_var_data_unittest.cc",
357 "proxy/serialized_var_unittest.cc",
dmichael342e8802015-03-31 22:48:40358 "proxy/tracked_callback_unittest.cc",
brettw31f4de692015-03-04 17:24:45359 "proxy/video_decoder_resource_unittest.cc",
360 "proxy/video_encoder_resource_unittest.cc",
361 "proxy/websocket_resource_unittest.cc",
362 "shared_impl/media_stream_audio_track_shared_unittest.cc",
363 "shared_impl/media_stream_buffer_manager_unittest.cc",
364 "shared_impl/media_stream_video_track_shared_unittest.cc",
365 "shared_impl/proxy_lock_unittest.cc",
366 "shared_impl/resource_tracker_unittest.cc",
367 "shared_impl/thread_aware_callback_unittest.cc",
368 "shared_impl/time_conversion_unittest.cc",
brettw31f4de692015-03-04 17:24:45369 "shared_impl/var_tracker_unittest.cc",
370 ]
371
372 deps = [
brettw31f4de692015-03-04 17:24:45373 "//base/test:test_support",
fsamuel19acfae2016-03-22 05:38:24374 "//gpu/ipc/common:command_buffer_traits",
brettw31f4de692015-03-04 17:24:45375 "//ipc",
rockot6d7be622016-06-15 18:25:19376 "//ipc:run_all_unittests",
brettw31f4de692015-03-04 17:24:45377 "//ipc:test_support",
378 "//media:shared_memory_support",
379 "//ppapi/host",
380 "//ppapi/proxy",
381 "//ppapi/proxy:test_support",
382 "//ppapi/shared_impl",
383 "//ppapi/shared_impl:test_support",
tomhudson21f6e9ba2016-02-01 14:06:40384 "//skia",
brettw31f4de692015-03-04 17:24:45385 "//testing/gmock",
386 "//testing/gtest",
387 "//ui/surface",
388 ]
389}
390
391test("ppapi_perftests") {
392 sources = [
393 "proxy/ppapi_perftests.cc",
394 "proxy/ppp_messaging_proxy_perftest.cc",
395 ]
396
397 deps = [
brettw31f4de692015-03-04 17:24:45398 "//base/test:test_support",
rockot6d7be622016-06-15 18:25:19399 "//mojo/edk/system",
brettw31f4de692015-03-04 17:24:45400 "//ppapi/proxy",
401 "//ppapi/proxy:test_support",
402 "//ppapi/shared_impl",
403 "//ppapi/shared_impl:test_support",
404 "//testing/gtest",
405 ]
406}
dprankec09ccaa2015-03-27 22:00:38407
408executable("pepper_hash_for_uma") {
409 sources = [
410 "tools/pepper_hash_for_uma.cc",
411 ]
412
413 deps = [
414 "//base",
thomasanderson84fa8b02017-05-18 23:38:47415 "//build/config:exe_and_shlib_deps",
brucedawsonf9f7d6292016-04-27 19:11:07416 "//build/win:default_exe_manifest",
dprankec09ccaa2015-03-27 22:00:38417 ]
418}
phosek73470e02015-08-28 22:34:28419
phosek73470e02015-08-28 22:34:28420source_set("ppapi_gles2_lib") {
421 include_dirs = [ "lib/gl/include" ]
422 sources = [
423 "lib/gl/gles2/gl2ext_ppapi.c",
424 "lib/gl/gles2/gl2ext_ppapi.h",
425 "lib/gl/gles2/gles2.c",
426 ]
427 deps = [
428 "//ppapi/cpp",
429 ]
430}
431
Nico Weber524e0f862015-09-02 22:23:10432if (enable_nacl) {
phoseke19dffc2016-05-09 07:03:49433 import("//ppapi/native_client/nacl_test_data.gni")
434
thakis92ba97f2015-09-02 17:21:37435 if (is_nacl) {
phoseke19dffc2016-05-09 07:03:49436 nacl_test_data("ppapi_nacl_tests") {
phosek70a330f2015-09-24 03:23:22437 include_dirs = [ "lib/gl/include" ]
brettw9d6a868b2016-08-30 05:52:06438 sources = test_common_source_files
439
440 sources += [
441 "tests/test_nacl_irt_stack_alignment.cc",
442 "tests/test_nacl_irt_stack_alignment.h",
443 "tests/test_tcp_server_socket_private_disallowed.cc",
thakisb8590c92017-03-23 18:14:53444 "tests/test_tcp_server_socket_private_disallowed.h",
brettw9d6a868b2016-08-30 05:52:06445 "tests/test_tcp_socket_private_disallowed.cc",
thakisb8590c92017-03-23 18:14:53446 "tests/test_tcp_socket_private_disallowed.h",
brettw9d6a868b2016-08-30 05:52:06447 "tests/test_udp_socket_private_disallowed.cc",
thakisb8590c92017-03-23 18:14:53448 "tests/test_udp_socket_private_disallowed.h",
brettw9d6a868b2016-08-30 05:52:06449 ]
450
phosek70a330f2015-09-24 03:23:22451 defines = [
452 "GL_GLEXT_PROTOTYPES",
453 "PPAPI_TEST_IMPLEMENTATION",
454 ]
thakis92ba97f2015-09-02 17:21:37455 deps = [
brettw9d6a868b2016-08-30 05:52:06456 "//ppapi/cpp",
thakis92ba97f2015-09-02 17:21:37457 ]
phosekc6352812015-10-06 20:34:55458 if (current_cpu == "pnacl") {
phoseke19dffc2016-05-09 07:03:49459 pretranslate_pexe = true
phosekc6352812015-10-06 20:34:55460 }
thakis92ba97f2015-09-02 17:21:37461 }
phosek73470e02015-08-28 22:34:28462 }
463
phosek70a330f2015-09-24 03:23:22464 group("ppapi_nacl_tests_all") {
mcgrathr13eefcb2015-10-22 19:35:07465 data_deps = [
466 ":copy_test_files",
phoseke19dffc2016-05-09 07:03:49467 ":ppapi_nacl_tests(//build/toolchain/nacl:clang_newlib_${target_cpu})",
mcgrathr0c27b8c2016-01-20 19:51:11468 ":ppapi_nacl_tests(//build/toolchain/nacl:newlib_pnacl)",
mcgrathr13eefcb2015-10-22 19:35:07469 ]
milko.leporis3de038d2016-08-18 09:59:37470
471 if (target_cpu != "mipsel") {
472 data_deps +=
473 [ ":ppapi_nacl_tests(//build/toolchain/nacl:glibc_${target_cpu})" ]
474 }
475
476 if (is_linux && enable_nacl_nonsfi) {
477 data_deps +=
478 [ ":ppapi_nacl_tests(//build/toolchain/nacl:newlib_pnacl_nonsfi)" ]
479 }
phosek73470e02015-08-28 22:34:28480 }
481}