BUILD.gn 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  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. import("//build/config/features.gni")
  5. import("//build/config/nacl/config.gni")
  6. import("//build/config/nacl/rules.gni")
  7. import("//components/nacl/features.gni")
  8. import("//components/nacl/target_cpu.gni")
  9. import("//ppapi/buildflags/buildflags.gni")
  10. import("//testing/test.gni")
  11. if (is_mac) {
  12. import("//build/config/mac/rules.gni")
  13. }
  14. assert(enable_ppapi)
  15. # Test files shared between several targets below.
  16. #
  17. # TODO(brettw) it seems like it should be possible to factor this in a source
  18. # set that is shared in such a way that these only need to be referenced once.
  19. test_common_source_files = [
  20. "lib/gl/gles2/gl2ext_ppapi.c",
  21. "lib/gl/gles2/gl2ext_ppapi.h",
  22. "lib/gl/gles2/gles2.c",
  23. "tests/all_c_includes.h",
  24. "tests/all_cpp_includes.h",
  25. "tests/arch_dependent_sizes_32.h",
  26. "tests/arch_dependent_sizes_64.h",
  27. "tests/pp_thread.h",
  28. "tests/test_audio.cc",
  29. "tests/test_audio.h",
  30. "tests/test_audio_config.cc",
  31. "tests/test_audio_config.h",
  32. "tests/test_case.cc",
  33. "tests/test_case.h",
  34. "tests/test_console.cc",
  35. "tests/test_console.h",
  36. "tests/test_core.cc",
  37. "tests/test_core.h",
  38. "tests/test_cursor_control.cc",
  39. "tests/test_cursor_control.h",
  40. "tests/test_empty.cc",
  41. "tests/test_empty.h",
  42. "tests/test_file_io.cc",
  43. "tests/test_file_io.h",
  44. "tests/test_file_ref.cc",
  45. "tests/test_file_ref.h",
  46. "tests/test_file_system.cc",
  47. "tests/test_file_system.h",
  48. "tests/test_fullscreen.cc",
  49. "tests/test_fullscreen.h",
  50. "tests/test_graphics_2d.cc",
  51. "tests/test_graphics_2d.h",
  52. "tests/test_graphics_3d.cc",
  53. "tests/test_graphics_3d.h",
  54. "tests/test_host_resolver.cc",
  55. "tests/test_host_resolver.h",
  56. "tests/test_host_resolver_crash.cc",
  57. "tests/test_host_resolver_crash.h",
  58. "tests/test_host_resolver_private.cc",
  59. "tests/test_host_resolver_private.h",
  60. "tests/test_host_resolver_private_disallowed.cc",
  61. "tests/test_host_resolver_private_disallowed.h",
  62. "tests/test_image_data.cc",
  63. "tests/test_image_data.h",
  64. "tests/test_ime_input_event.cc",
  65. "tests/test_ime_input_event.h",
  66. "tests/test_input_event.cc",
  67. "tests/test_input_event.h",
  68. "tests/test_media_stream_audio_track.cc",
  69. "tests/test_media_stream_audio_track.h",
  70. "tests/test_media_stream_video_track.cc",
  71. "tests/test_media_stream_video_track.h",
  72. "tests/test_memory.cc",
  73. "tests/test_memory.h",
  74. "tests/test_message_handler.cc",
  75. "tests/test_message_handler.h",
  76. "tests/test_message_loop.cc",
  77. "tests/test_message_loop.h",
  78. "tests/test_mouse_cursor.cc",
  79. "tests/test_mouse_cursor.h",
  80. "tests/test_mouse_lock.cc",
  81. "tests/test_mouse_lock.h",
  82. "tests/test_net_address.cc",
  83. "tests/test_net_address.h",
  84. "tests/test_net_address_private_untrusted.cc",
  85. "tests/test_net_address_private_untrusted.h",
  86. "tests/test_network_monitor.cc",
  87. "tests/test_network_monitor.h",
  88. "tests/test_network_proxy.cc",
  89. "tests/test_network_proxy.h",
  90. "tests/test_paint_aggregator.cc",
  91. "tests/test_paint_aggregator.h",
  92. "tests/test_post_message.cc",
  93. "tests/test_post_message.h",
  94. "tests/test_printing.cc",
  95. "tests/test_printing.h",
  96. "tests/test_tcp_server_socket_private.cc",
  97. "tests/test_tcp_server_socket_private.h",
  98. "tests/test_tcp_socket.cc",
  99. "tests/test_tcp_socket.h",
  100. "tests/test_tcp_socket_private.cc",
  101. "tests/test_tcp_socket_private.h",
  102. "tests/test_tcp_socket_private_crash.cc",
  103. "tests/test_tcp_socket_private_crash.h",
  104. "tests/test_test_internals.cc",
  105. "tests/test_test_internals.h",
  106. "tests/test_trace_event.cc",
  107. "tests/test_trace_event.h",
  108. "tests/test_udp_socket.cc",
  109. "tests/test_udp_socket.h",
  110. "tests/test_udp_socket_private.cc",
  111. "tests/test_udp_socket_private.h",
  112. "tests/test_uma.cc",
  113. "tests/test_uma.h",
  114. "tests/test_url_loader.cc",
  115. "tests/test_url_loader.h",
  116. "tests/test_url_request.cc",
  117. "tests/test_url_request.h",
  118. "tests/test_utils.h",
  119. "tests/test_utils.cc",
  120. "tests/test_var.cc",
  121. "tests/test_var.h",
  122. "tests/test_var_resource.cc",
  123. "tests/test_var_resource.h",
  124. "tests/test_video_decoder.cc",
  125. "tests/test_video_decoder.h",
  126. "tests/test_video_encoder.cc",
  127. "tests/test_video_encoder.h",
  128. "tests/test_view.cc",
  129. "tests/test_view.h",
  130. "tests/test_websocket.cc",
  131. "tests/test_websocket.h",
  132. "tests/testing_instance.cc",
  133. "tests/testing_instance.h",
  134. # Compile-time tests
  135. "tests/test_c_includes.c",
  136. "tests/test_cpp_includes.cc",
  137. "tests/test_struct_sizes.c",
  138. ]
  139. copy("copy_test_files") {
  140. sources = [
  141. # Keep "test_case.html.mock-http-headers" with "test_case.html"
  142. # and "corb_eligible_resource.json.mock-http-headers" with
  143. # "corb_eligible_resource.json".
  144. "tests/corb_eligible_resource.json",
  145. "tests/corb_eligible_resource.json.mock-http-headers",
  146. "tests/test_case.html",
  147. "tests/test_case.html.mock-http-headers",
  148. "tests/test_page.css",
  149. "tests/test_page.css.mock-http-headers",
  150. ]
  151. outputs = [ "$root_out_dir/{{source_file_part}}" ]
  152. }
  153. copy("copy_test_files2") {
  154. sources = [ "tests/test_url_loader_data/hello.txt" ]
  155. outputs = [ "$root_out_dir/test_url_loader_data/{{source_file_part}}" ]
  156. }
  157. source_set("ppapi_tests_sources") {
  158. sources = test_common_source_files
  159. sources += [
  160. "tests/test_browser_font.cc",
  161. "tests/test_browser_font.h",
  162. "tests/test_buffer.cc",
  163. "tests/test_buffer.h",
  164. "tests/test_char_set.cc",
  165. "tests/test_char_set.h",
  166. "tests/test_crypto.cc",
  167. "tests/test_crypto.h",
  168. "tests/test_file_chooser.cc",
  169. "tests/test_file_chooser.h",
  170. "tests/test_net_address_private.cc",
  171. "tests/test_net_address_private.h",
  172. "tests/test_tcp_socket_private_trusted.cc",
  173. "tests/test_tcp_socket_private_trusted.h",
  174. "tests/test_url_util.cc",
  175. "tests/test_url_util.h",
  176. "tests/test_utils.h",
  177. "tests/test_video_decoder_dev.cc",
  178. "tests/test_video_decoder_dev.h",
  179. "tests/test_x509_certificate_private.cc",
  180. "tests/test_x509_certificate_private.h",
  181. # Deprecated test cases.
  182. "tests/test_instance_deprecated.cc",
  183. "tests/test_instance_deprecated.h",
  184. "tests/test_var_deprecated.cc",
  185. "tests/test_var_deprecated.h",
  186. ]
  187. configs += [
  188. "//build/config:precompiled_headers",
  189. "//v8:external_startup_data",
  190. ]
  191. defines = [ "GL_GLEXT_PROTOTYPES" ]
  192. include_dirs = [ "lib/gl/include" ]
  193. deps = [
  194. ":copy_test_files",
  195. ":copy_test_files2",
  196. "//ppapi/cpp",
  197. "//ppapi/shared_impl",
  198. ]
  199. }
  200. if (is_mac) {
  201. ppapi_tests_target_type = "mac_plugin_bundle"
  202. } else {
  203. ppapi_tests_target_type = "shared_library"
  204. }
  205. target(ppapi_tests_target_type, "ppapi_tests") {
  206. deps = [ ":ppapi_tests_sources" ]
  207. }
  208. source_set("blink_deprecated_test_plugin_sources") {
  209. sources = [ "tests/blink_deprecated_test_plugin.cc" ]
  210. deps = [
  211. "//base",
  212. "//ppapi/cpp",
  213. "//ppapi/shared_impl",
  214. ]
  215. }
  216. if (!is_mac) {
  217. loadable_module("blink_deprecated_test_plugin") {
  218. deps = [ ":blink_deprecated_test_plugin_sources" ]
  219. }
  220. } else {
  221. mac_plugin_bundle("blink_deprecated_test_plugin") {
  222. deps = [ ":blink_deprecated_test_plugin_sources" ]
  223. }
  224. }
  225. source_set("blink_test_plugin_sources") {
  226. sources = [ "tests/blink_test_plugin.cc" ]
  227. deps = [
  228. "//base",
  229. "//ppapi/cpp",
  230. "//ppapi/shared_impl",
  231. ]
  232. }
  233. if (!is_mac) {
  234. loadable_module("blink_test_plugin") {
  235. deps = [ ":blink_test_plugin_sources" ]
  236. }
  237. } else {
  238. mac_plugin_bundle("blink_test_plugin") {
  239. deps = [ ":blink_test_plugin_sources" ]
  240. }
  241. }
  242. test("ppapi_unittests") {
  243. sources = [
  244. "host/resource_message_filter_unittest.cc",
  245. "proxy/device_enumeration_resource_helper_unittest.cc",
  246. "proxy/file_chooser_resource_unittest.cc",
  247. "proxy/file_system_resource_unittest.cc",
  248. "proxy/interface_list_unittest.cc",
  249. "proxy/mock_resource.cc",
  250. "proxy/mock_resource.h",
  251. "proxy/nacl_message_scanner_unittest.cc",
  252. "proxy/plugin_dispatcher_unittest.cc",
  253. "proxy/plugin_resource_tracker_unittest.cc",
  254. "proxy/plugin_var_tracker_unittest.cc",
  255. "proxy/ppapi_command_buffer_proxy_unittest.cc",
  256. "proxy/ppb_var_unittest.cc",
  257. "proxy/ppp_instance_private_proxy_unittest.cc",
  258. "proxy/ppp_instance_proxy_unittest.cc",
  259. "proxy/ppp_messaging_proxy_unittest.cc",
  260. "proxy/printing_resource_unittest.cc",
  261. "proxy/raw_var_data_unittest.cc",
  262. "proxy/serialized_var_unittest.cc",
  263. "proxy/tracked_callback_unittest.cc",
  264. "proxy/video_decoder_resource_unittest.cc",
  265. "proxy/video_encoder_resource_unittest.cc",
  266. "proxy/websocket_resource_unittest.cc",
  267. "shared_impl/media_stream_audio_track_shared_unittest.cc",
  268. "shared_impl/media_stream_buffer_manager_unittest.cc",
  269. "shared_impl/media_stream_video_track_shared_unittest.cc",
  270. "shared_impl/proxy_lock_unittest.cc",
  271. "shared_impl/resource_tracker_unittest.cc",
  272. "shared_impl/thread_aware_callback_unittest.cc",
  273. "shared_impl/time_conversion_unittest.cc",
  274. "shared_impl/var_tracker_unittest.cc",
  275. ]
  276. deps = [
  277. "//base/test:test_support",
  278. "//gpu/ipc/common:command_buffer_traits",
  279. "//ipc",
  280. "//ipc:run_all_unittests",
  281. "//ipc:test_support",
  282. "//media:shared_memory_support",
  283. "//ppapi/host",
  284. "//ppapi/proxy",
  285. "//ppapi/proxy:test_support",
  286. "//ppapi/shared_impl",
  287. "//ppapi/shared_impl:test_support",
  288. "//skia",
  289. "//testing/gmock",
  290. "//testing/gtest",
  291. "//ui/surface",
  292. ]
  293. }
  294. test("ppapi_perftests") {
  295. sources = [
  296. "proxy/ppapi_perftests.cc",
  297. "proxy/ppp_messaging_proxy_perftest.cc",
  298. ]
  299. deps = [
  300. "//base/test:test_support",
  301. "//mojo/core/embedder",
  302. "//ppapi/proxy",
  303. "//ppapi/proxy:test_support",
  304. "//ppapi/shared_impl",
  305. "//ppapi/shared_impl:test_support",
  306. "//testing/gtest",
  307. ]
  308. }
  309. executable("pepper_hash_for_uma") {
  310. sources = [ "tools/pepper_hash_for_uma.cc" ]
  311. deps = [
  312. "//base",
  313. "//build/win:default_exe_manifest",
  314. ]
  315. }
  316. source_set("ppapi_gles2_lib") {
  317. include_dirs = [ "lib/gl/include" ]
  318. sources = [
  319. "lib/gl/gles2/gl2ext_ppapi.c",
  320. "lib/gl/gles2/gl2ext_ppapi.h",
  321. "lib/gl/gles2/gles2.c",
  322. ]
  323. deps = [ "//ppapi/cpp" ]
  324. }
  325. if (enable_nacl) {
  326. import("//ppapi/native_client/nacl_test_data.gni")
  327. if (is_nacl) {
  328. nacl_test_data("ppapi_nacl_tests") {
  329. include_dirs = [ "lib/gl/include" ]
  330. sources = test_common_source_files
  331. sources += [
  332. "tests/test_nacl_irt_stack_alignment.cc",
  333. "tests/test_nacl_irt_stack_alignment.h",
  334. "tests/test_tcp_server_socket_private_disallowed.cc",
  335. "tests/test_tcp_server_socket_private_disallowed.h",
  336. "tests/test_tcp_socket_private_disallowed.cc",
  337. "tests/test_tcp_socket_private_disallowed.h",
  338. "tests/test_udp_socket_private_disallowed.cc",
  339. "tests/test_udp_socket_private_disallowed.h",
  340. ]
  341. defines = [
  342. "GL_GLEXT_PROTOTYPES",
  343. "PPAPI_TEST_IMPLEMENTATION",
  344. ]
  345. deps = [
  346. "//ppapi/cpp",
  347. "//ppapi/native_client/src/untrusted/irt_stub:ppapi_stub_lib",
  348. ]
  349. if (current_cpu == "pnacl") {
  350. pretranslate_pexe = true
  351. }
  352. }
  353. }
  354. group("ppapi_nacl_tests_all") {
  355. data_deps = [
  356. ":copy_test_files",
  357. ":ppapi_nacl_tests(//build/toolchain/nacl:clang_newlib_${nacl_target_cpu})",
  358. ":ppapi_nacl_tests(//build/toolchain/nacl:newlib_pnacl)",
  359. ]
  360. if (target_cpu != "mipsel" && !is_mac && !is_win) {
  361. data_deps += [
  362. ":ppapi_nacl_tests(//build/toolchain/nacl:glibc_${nacl_target_cpu})",
  363. ]
  364. }
  365. }
  366. }