[M120 Migration][NaCl][PPFWK] Change plugin process name
[platform/framework/web/chromium-efl.git] / ppapi / BUILD.gn
1 # Copyright 2014 The Chromium Authors
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import("//build/config/features.gni")
6 import("//build/config/nacl/config.gni")
7 import("//build/config/nacl/rules.gni")
8 import("//components/nacl/features.gni")
9 import("//components/nacl/target_cpu.gni")
10 import("//ppapi/buildflags/buildflags.gni")
11 import("//testing/test.gni")
12 if (is_mac) {
13   import("//build/config/mac/rules.gni")
14 }
15
16 if (use_efl) {
17   import("//tizen_src/build/config/tizen_features.gni")
18 }
19
20 assert(enable_ppapi)
21
22 # Test files shared between several targets below.
23 #
24 # TODO(brettw) it seems like it should be possible to factor this in a source
25 # set that is shared in such a way that these only need to be referenced once.
26 test_common_source_files = [
27   "lib/gl/gles2/gl2ext_ppapi.c",
28   "lib/gl/gles2/gl2ext_ppapi.h",
29   "lib/gl/gles2/gles2.c",
30   "tests/all_c_includes.h",
31   "tests/all_cpp_includes.h",
32   "tests/arch_dependent_sizes_32.h",
33   "tests/arch_dependent_sizes_64.h",
34   "tests/pp_thread.h",
35   "tests/test_audio.cc",
36   "tests/test_audio.h",
37   "tests/test_audio_config.cc",
38   "tests/test_audio_config.h",
39   "tests/test_case.cc",
40   "tests/test_case.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_crash.cc",
64   "tests/test_host_resolver_crash.h",
65   "tests/test_host_resolver_private.cc",
66   "tests/test_host_resolver_private.h",
67   "tests/test_host_resolver_private_disallowed.cc",
68   "tests/test_host_resolver_private_disallowed.h",
69   "tests/test_image_data.cc",
70   "tests/test_image_data.h",
71   "tests/test_ime_input_event.cc",
72   "tests/test_ime_input_event.h",
73   "tests/test_input_event.cc",
74   "tests/test_input_event.h",
75   "tests/test_media_stream_audio_track.cc",
76   "tests/test_media_stream_audio_track.h",
77   "tests/test_media_stream_video_track.cc",
78   "tests/test_media_stream_video_track.h",
79   "tests/test_memory.cc",
80   "tests/test_memory.h",
81   "tests/test_message_handler.cc",
82   "tests/test_message_handler.h",
83   "tests/test_message_loop.cc",
84   "tests/test_message_loop.h",
85   "tests/test_mouse_cursor.cc",
86   "tests/test_mouse_cursor.h",
87   "tests/test_mouse_lock.cc",
88   "tests/test_mouse_lock.h",
89   "tests/test_net_address.cc",
90   "tests/test_net_address.h",
91   "tests/test_net_address_private_untrusted.cc",
92   "tests/test_net_address_private_untrusted.h",
93   "tests/test_network_monitor.cc",
94   "tests/test_network_monitor.h",
95   "tests/test_network_proxy.cc",
96   "tests/test_network_proxy.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_tcp_socket_private_crash.cc",
110   "tests/test_tcp_socket_private_crash.h",
111   "tests/test_test_internals.cc",
112   "tests/test_test_internals.h",
113   "tests/test_trace_event.cc",
114   "tests/test_trace_event.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.h",
126   "tests/test_utils.cc",
127   "tests/test_var.cc",
128   "tests/test_var.h",
129   "tests/test_var_resource.cc",
130   "tests/test_var_resource.h",
131   "tests/test_video_decoder.cc",
132   "tests/test_video_decoder.h",
133   "tests/test_video_encoder.cc",
134   "tests/test_video_encoder.h",
135   "tests/test_view.cc",
136   "tests/test_view.h",
137   "tests/test_websocket.cc",
138   "tests/test_websocket.h",
139   "tests/testing_instance.cc",
140   "tests/testing_instance.h",
141
142   # Compile-time tests
143   "tests/test_c_includes.c",
144   "tests/test_cpp_includes.cc",
145   "tests/test_struct_sizes.c",
146 ]
147
148 copy("copy_test_files") {
149   sources = [
150     # Keep "test_case.html.mock-http-headers" with "test_case.html"
151     # and "corb_eligible_resource.json.mock-http-headers" with
152     # "corb_eligible_resource.json".
153     "tests/corb_eligible_resource.json",
154     "tests/corb_eligible_resource.json.mock-http-headers",
155     "tests/test_case.html",
156     "tests/test_case.html.mock-http-headers",
157     "tests/test_page.css",
158     "tests/test_page.css.mock-http-headers",
159   ]
160   outputs = [ "$root_out_dir/{{source_file_part}}" ]
161 }
162
163 copy("copy_test_files2") {
164   sources = [ "tests/test_url_loader_data/hello.txt" ]
165   outputs = [ "$root_out_dir/test_url_loader_data/{{source_file_part}}" ]
166 }
167
168 source_set("ppapi_tests_sources") {
169   sources = test_common_source_files
170   sources += [
171     "tests/test_browser_font.cc",
172     "tests/test_browser_font.h",
173     "tests/test_buffer.cc",
174     "tests/test_buffer.h",
175     "tests/test_char_set.cc",
176     "tests/test_char_set.h",
177     "tests/test_crypto.cc",
178     "tests/test_crypto.h",
179     "tests/test_file_chooser.cc",
180     "tests/test_file_chooser.h",
181     "tests/test_net_address_private.cc",
182     "tests/test_net_address_private.h",
183     "tests/test_tcp_socket_private_trusted.cc",
184     "tests/test_tcp_socket_private_trusted.h",
185     "tests/test_url_util.cc",
186     "tests/test_url_util.h",
187     "tests/test_video_decoder_dev.cc",
188     "tests/test_video_decoder_dev.h",
189     "tests/test_x509_certificate_private.cc",
190     "tests/test_x509_certificate_private.h",
191
192     # Deprecated test cases.
193     "tests/test_instance_deprecated.cc",
194     "tests/test_instance_deprecated.h",
195     "tests/test_var_deprecated.cc",
196     "tests/test_var_deprecated.h",
197   ]
198
199   configs += [
200     "//build/config:precompiled_headers",
201     "//v8:external_startup_data",
202   ]
203
204   defines = [ "GL_GLEXT_PROTOTYPES" ]
205   include_dirs = [ "lib/gl/include" ]
206
207   deps = [
208     ":copy_test_files",
209     ":copy_test_files2",
210     "//ppapi/cpp",
211     "//ppapi/shared_impl",
212   ]
213 }
214
215 if (is_mac) {
216   ppapi_tests_target_type = "mac_plugin_bundle"
217 } else {
218   ppapi_tests_target_type = "shared_library"
219 }
220 target(ppapi_tests_target_type, "ppapi_tests") {
221   deps = [ ":ppapi_tests_sources" ]
222 }
223
224 source_set("blink_deprecated_test_plugin_sources") {
225   sources = [ "tests/blink_deprecated_test_plugin.cc" ]
226
227   deps = [
228     "//base",
229     "//ppapi/cpp",
230     "//ppapi/shared_impl",
231   ]
232 }
233
234 if (!is_mac) {
235   loadable_module("blink_deprecated_test_plugin") {
236     deps = [ ":blink_deprecated_test_plugin_sources" ]
237   }
238 } else {
239   mac_plugin_bundle("blink_deprecated_test_plugin") {
240     deps = [ ":blink_deprecated_test_plugin_sources" ]
241   }
242 }
243
244 source_set("blink_test_plugin_sources") {
245   sources = [ "tests/blink_test_plugin.cc" ]
246
247   deps = [
248     "//base",
249     "//ppapi/cpp",
250     "//ppapi/shared_impl",
251   ]
252 }
253
254 if (!is_mac) {
255   loadable_module("blink_test_plugin") {
256     deps = [ ":blink_test_plugin_sources" ]
257   }
258 } else {
259   mac_plugin_bundle("blink_test_plugin") {
260     deps = [ ":blink_test_plugin_sources" ]
261   }
262 }
263
264 test("ppapi_unittests") {
265   sources = [
266     "host/resource_message_filter_unittest.cc",
267     "proxy/device_enumeration_resource_helper_unittest.cc",
268     "proxy/file_chooser_resource_unittest.cc",
269     "proxy/file_system_resource_unittest.cc",
270     "proxy/interface_list_unittest.cc",
271     "proxy/mock_resource.cc",
272     "proxy/mock_resource.h",
273     "proxy/nacl_message_scanner_unittest.cc",
274     "proxy/plugin_dispatcher_unittest.cc",
275     "proxy/plugin_resource_tracker_unittest.cc",
276     "proxy/plugin_var_tracker_unittest.cc",
277     "proxy/ppapi_command_buffer_proxy_unittest.cc",
278     "proxy/ppb_var_unittest.cc",
279     "proxy/ppp_instance_private_proxy_unittest.cc",
280     "proxy/ppp_instance_proxy_unittest.cc",
281     "proxy/ppp_messaging_proxy_unittest.cc",
282     "proxy/printing_resource_unittest.cc",
283     "proxy/raw_var_data_unittest.cc",
284     "proxy/serialized_var_unittest.cc",
285     "proxy/tracked_callback_unittest.cc",
286     "proxy/video_decoder_resource_unittest.cc",
287     "proxy/video_encoder_resource_unittest.cc",
288     "proxy/websocket_resource_unittest.cc",
289     "shared_impl/media_stream_audio_track_shared_unittest.cc",
290     "shared_impl/media_stream_buffer_manager_unittest.cc",
291     "shared_impl/media_stream_video_track_shared_unittest.cc",
292     "shared_impl/proxy_lock_unittest.cc",
293     "shared_impl/resource_tracker_unittest.cc",
294     "shared_impl/thread_aware_callback_unittest.cc",
295     "shared_impl/time_conversion_unittest.cc",
296     "shared_impl/var_tracker_unittest.cc",
297   ]
298
299   if (tizen_pepper_extensions == 1 && enable_plugins == 1) {
300     sources += [ "proxy/var_value_converter_unittest.cc" ]
301   }
302
303   deps = [
304     "//base/test:test_support",
305     "//gpu/ipc/common:command_buffer_traits",
306     "//ipc",
307     "//ipc:run_all_unittests",
308     "//ipc:test_support",
309     "//media:shared_memory_support",
310     "//ppapi/host",
311     "//ppapi/proxy",
312     "//ppapi/proxy:test_support",
313     "//ppapi/shared_impl",
314     "//ppapi/shared_impl:test_support",
315     "//skia",
316     "//testing/gmock",
317     "//testing/gtest",
318     "//ui/surface",
319   ]
320 }
321
322 test("ppapi_perftests") {
323   sources = [
324     "proxy/ppapi_perftests.cc",
325     "proxy/ppp_messaging_proxy_perftest.cc",
326   ]
327
328   deps = [
329     "//base/test:test_support",
330     "//mojo/core/embedder",
331     "//ppapi/proxy",
332     "//ppapi/proxy:test_support",
333     "//ppapi/shared_impl",
334     "//ppapi/shared_impl:test_support",
335     "//testing/gtest",
336   ]
337 }
338
339 executable("pepper_hash_for_uma") {
340   sources = [ "tools/pepper_hash_for_uma.cc" ]
341
342   deps = [
343     "//base",
344     "//build/win:default_exe_manifest",
345   ]
346 }
347
348 source_set("ppapi_gles2_lib") {
349   include_dirs = [ "lib/gl/include" ]
350   sources = [
351     "lib/gl/gles2/gl2ext_ppapi.c",
352     "lib/gl/gles2/gl2ext_ppapi.h",
353     "lib/gl/gles2/gles2.c",
354   ]
355   deps = [ "//ppapi/cpp" ]
356 }
357
358 if (enable_nacl) {
359   import("//ppapi/native_client/nacl_test_data.gni")
360
361   if (is_nacl) {
362     nacl_test_data("ppapi_nacl_tests") {
363       include_dirs = [ "lib/gl/include" ]
364       sources = test_common_source_files
365
366       sources += [
367         "tests/test_nacl_irt_stack_alignment.cc",
368         "tests/test_nacl_irt_stack_alignment.h",
369         "tests/test_tcp_server_socket_private_disallowed.cc",
370         "tests/test_tcp_server_socket_private_disallowed.h",
371         "tests/test_tcp_socket_private_disallowed.cc",
372         "tests/test_tcp_socket_private_disallowed.h",
373         "tests/test_udp_socket_private_disallowed.cc",
374         "tests/test_udp_socket_private_disallowed.h",
375       ]
376
377       defines = [
378         "GL_GLEXT_PROTOTYPES",
379         "PPAPI_TEST_IMPLEMENTATION",
380       ]
381       deps = [
382         "//ppapi/cpp",
383         "//ppapi/native_client/src/untrusted/irt_stub:ppapi_stub_lib",
384       ]
385       if (current_cpu == "pnacl") {
386         pretranslate_pexe = true
387       }
388     }
389   }
390
391   group("ppapi_nacl_tests_all") {
392     data_deps = [
393       ":copy_test_files",
394       ":ppapi_nacl_tests(//build/toolchain/nacl:clang_newlib_${nacl_target_cpu})",
395       ":ppapi_nacl_tests(//build/toolchain/nacl:newlib_pnacl)",
396     ]
397
398     if (target_cpu != "mipsel" && !is_mac && !is_win) {
399       data_deps += [
400         ":ppapi_nacl_tests(//build/toolchain/nacl:glibc_${nacl_target_cpu})",
401       ]
402     }
403   }
404 }