1 # Copyright (c) 2012 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 5 { 6 'targets': [ 7 { 8 'target_name': 'ppapi_tests', 9 'type': 'loadable_module', 10 'include_dirs': [ 11 'lib/gl/include', 12 ], 13 'defines': [ 14 'GL_GLEXT_PROTOTYPES', 15 ], 16 'sources': [ 17 '<@(test_common_source_files)', 18 '<@(test_trusted_source_files)', 19 ], 20 'dependencies': [ 21 'ppapi.gyp:ppapi_cpp', 22 'ppapi_internal.gyp:ppapi_shared', 23 ], 24 'copies': [ 25 { 26 'destination': '<(PRODUCT_DIR)', 27 'files': [ 28 # Keep 'test_case.html.mock-http-headers' with 'test_case.html'. 29 'tests/test_case.html', 30 'tests/test_case.html.mock-http-headers', 31 'tests/test_page.css', 32 'tests/ppapi_nacl_tests_newlib.nmf', 33 ], 34 }, 35 { 36 'destination': '<(PRODUCT_DIR)/test_url_loader_data', 37 'files': [ 38 'tests/test_url_loader_data/hello.txt', 39 ], 40 }, 41 ], 42 'run_as': { 43 'action': [ 44 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)chrome<(EXECUTABLE_SUFFIX)', 45 '--enable-pepper-testing', 46 '--register-pepper-plugins=$(TargetPath);application/x-ppapi-tests', 47 'file://$(ProjectDir)/tests/test_case.html?testcase=', 48 ], 49 }, 50 'conditions': [ 51 ['OS=="win"', { 52 'defines': [ 53 '_CRT_SECURE_NO_DEPRECATE', 54 '_CRT_NONSTDC_NO_WARNINGS', 55 '_CRT_NONSTDC_NO_DEPRECATE', 56 '_SCL_SECURE_NO_DEPRECATE', 57 ], 58 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 59 'msvs_disabled_warnings': [ 4267, ], 60 }], 61 ['OS=="mac"', { 62 'mac_bundle': 1, 63 'product_name': 'ppapi_tests', 64 'product_extension': 'plugin', 65 }], 66 ], 67 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 68 'msvs_disabled_warnings': [ 4267, ], 69 # TODO(dmichael): Figure out what is wrong with the script on Windows and add 70 # it as an automated action. 71 # 'actions': [ 72 # { 73 # 'action_name': 'generate_ppapi_include_tests', 74 # 'inputs': [], 75 # 'outputs': [ 76 # 'tests/test_c_includes.c', 77 # 'tests/test_cc_includes.cc', 78 # ], 79 # 'action': [ 80 # '<!@(python generate_ppapi_include_tests.py)', 81 # ], 82 # }, 83 # ], 84 }, 85 { 86 'target_name': 'ppapi_unittest_shared', 87 'type': 'static_library', 88 'dependencies': [ 89 'ppapi_proxy', 90 'ppapi_shared', 91 '../base/base.gyp:test_support_base', 92 '../ipc/ipc.gyp:ipc', 93 '../ipc/ipc.gyp:test_support_ipc', 94 '../testing/gmock.gyp:gmock', 95 '../testing/gtest.gyp:gtest', 96 ], 97 'sources': [ 98 'proxy/ppapi_proxy_test.cc', 99 'proxy/ppapi_proxy_test.h', 100 'proxy/resource_message_test_sink.cc', 101 'proxy/resource_message_test_sink.h', 102 'shared_impl/test_globals.cc', 103 'shared_impl/test_globals.h', 104 'shared_impl/unittest_utils.cc', 105 'shared_impl/unittest_utils.h', 106 ], 107 }, 108 109 { 110 'target_name': 'ppapi_perftests', 111 'type': 'executable', 112 'variables': { 113 'chromium_code': 1, 114 }, 115 'dependencies': [ 116 'ppapi_proxy', 117 'ppapi_shared', 118 'ppapi_unittest_shared', 119 '../base/base.gyp:test_support_base', 120 '../testing/gtest.gyp:gtest', 121 ], 122 'sources': [ 123 'proxy/ppapi_perftests.cc', 124 'proxy/ppp_messaging_proxy_perftest.cc', 125 ], 126 'conditions': [ 127 # See http://crbug.com/162998#c4 for why this is needed. 128 ['OS=="linux" and linux_use_tcmalloc==1', { 129 'dependencies': [ 130 '../base/allocator/allocator.gyp:allocator', 131 ], 132 }], 133 ], 134 }, 135 { 136 'target_name': 'ppapi_unittests', 137 'type': 'executable', 138 'variables': { 139 'chromium_code': 1, 140 }, 141 'dependencies': [ 142 'ppapi_host', 143 'ppapi_proxy', 144 'ppapi_shared', 145 'ppapi_unittest_shared', 146 '../base/base.gyp:run_all_unittests', 147 '../base/base.gyp:test_support_base', 148 '../gpu/gpu.gyp:gpu_ipc', 149 '../ipc/ipc.gyp:ipc', 150 '../ipc/ipc.gyp:test_support_ipc', 151 '../media/media.gyp:shared_memory_support', 152 '../testing/gmock.gyp:gmock', 153 '../testing/gtest.gyp:gtest', 154 '../ui/surface/surface.gyp:surface', 155 ], 156 # For the nacl_http_response_headers_unittest below. 157 'include_dirs': [ 158 '../ppapi', 159 ], 160 'sources': [ 161 'host/resource_message_filter_unittest.cc', 162 # Piggy back on ppapi_unittests for a simple NaCl unittest, 163 # which must not have dependencies on anything other than stdlibs. 164 # We add the source file, not just the test to ensure that the object 165 # is built. Otherwise, we would need to depend on the NaCl trusted 166 # plugin being built to build the object. 167 # TODO(jvoung): move this to unit_tests instead of ppapi_unittests 168 # once this moves into chrome. 169 'native_client/src/trusted/plugin/nacl_http_response_headers.cc', 170 'native_client/src/trusted/plugin/nacl_http_response_headers_unittest.cc', 171 'proxy/device_enumeration_resource_helper_unittest.cc', 172 'proxy/file_chooser_resource_unittest.cc', 173 'proxy/flash_resource_unittest.cc', 174 'proxy/mock_resource.cc', 175 'proxy/mock_resource.h', 176 'proxy/pdf_resource_unittest.cc', 177 'proxy/plugin_dispatcher_unittest.cc', 178 'proxy/plugin_resource_tracker_unittest.cc', 179 'proxy/plugin_var_tracker_unittest.cc', 180 'proxy/ppb_var_unittest.cc', 181 'proxy/ppp_instance_private_proxy_unittest.cc', 182 'proxy/ppp_instance_proxy_unittest.cc', 183 'proxy/ppp_messaging_proxy_unittest.cc', 184 'proxy/printing_resource_unittest.cc', 185 'proxy/raw_var_data_unittest.cc', 186 'proxy/serialized_var_unittest.cc', 187 'proxy/talk_resource_unittest.cc', 188 'proxy/websocket_resource_unittest.cc', 189 'shared_impl/proxy_lock_unittest.cc', 190 'shared_impl/resource_tracker_unittest.cc', 191 'shared_impl/thread_aware_callback_unittest.cc', 192 'shared_impl/time_conversion_unittest.cc', 193 'shared_impl/tracked_callback_unittest.cc', 194 'shared_impl/var_tracker_unittest.cc', 195 'shared_impl/var_value_conversions_unittest.cc', 196 ], 197 'conditions': [ 198 [ 'os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', { 199 'conditions': [ 200 [ 'linux_use_tcmalloc == 1', { 201 'dependencies': [ 202 '../base/allocator/allocator.gyp:allocator', 203 ], 204 }], 205 ], 206 }], 207 ], 208 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 209 'msvs_disabled_warnings': [ 4267, ], 210 }, 211 { 212 'target_name': 'ppapi_example_skeleton', 213 'suppress_wildcard': 1, 214 'type': 'none', 215 'direct_dependent_settings': { 216 'product_name': '>(_target_name)', 217 'conditions': [ 218 ['os_posix==1 and OS!="mac"', { 219 'cflags': ['-fvisibility=hidden'], 220 'type': 'shared_library', 221 }], 222 ['OS=="win"', { 223 'type': 'shared_library', 224 }], 225 ['OS=="mac"', { 226 'type': 'loadable_module', 227 'mac_bundle': 1, 228 'product_extension': 'plugin', 229 'xcode_settings': { 230 'OTHER_LDFLAGS': [ 231 # Not to strip important symbols by -Wl,-dead_strip. 232 '-Wl,-exported_symbol,_PPP_GetInterface', 233 '-Wl,-exported_symbol,_PPP_InitializeModule', 234 '-Wl,-exported_symbol,_PPP_ShutdownModule' 235 ]}, 236 }], 237 ], 238 }, 239 }, 240 { 241 'target_name': 'ppapi_example_mouse_cursor', 242 'dependencies': [ 243 'ppapi_example_skeleton', 244 'ppapi.gyp:ppapi_cpp', 245 ], 246 'sources': [ 247 'examples/mouse_cursor/mouse_cursor.cc', 248 ], 249 }, 250 { 251 'target_name': 'ppapi_example_mouse_lock', 252 'dependencies': [ 253 'ppapi_example_skeleton', 254 'ppapi.gyp:ppapi_cpp', 255 ], 256 'sources': [ 257 'examples/mouse_lock/mouse_lock.cc', 258 ], 259 }, 260 261 { 262 'target_name': 'ppapi_example_gamepad', 263 'dependencies': [ 264 'ppapi_example_skeleton', 265 'ppapi.gyp:ppapi_cpp', 266 ], 267 'sources': [ 268 'examples/gamepad/gamepad.cc', 269 ], 270 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 271 'msvs_disabled_warnings': [ 4267, ], 272 }, 273 274 { 275 'target_name': 'ppapi_example_c_stub', 276 'dependencies': [ 277 'ppapi_example_skeleton', 278 'ppapi.gyp:ppapi_c', 279 ], 280 'sources': [ 281 'examples/stub/stub.c', 282 ], 283 }, 284 { 285 'target_name': 'ppapi_example_cc_stub', 286 'dependencies': [ 287 'ppapi_example_skeleton', 288 'ppapi.gyp:ppapi_cpp', 289 ], 290 'sources': [ 291 'examples/stub/stub.cc', 292 ], 293 }, 294 { 295 'target_name': 'ppapi_example_crxfs', 296 'dependencies': [ 297 'ppapi_example_skeleton', 298 'ppapi.gyp:ppapi_cpp', 299 ], 300 'sources': [ 301 'examples/crxfs/crxfs.cc', 302 ], 303 }, 304 { 305 'target_name': 'ppapi_example_audio', 306 'dependencies': [ 307 'ppapi_example_skeleton', 308 'ppapi.gyp:ppapi_cpp', 309 ], 310 'sources': [ 311 'examples/audio/audio.cc', 312 ], 313 }, 314 { 315 'target_name': 'ppapi_example_audio_input', 316 'dependencies': [ 317 'ppapi_example_skeleton', 318 'ppapi.gyp:ppapi_cpp', 319 ], 320 'sources': [ 321 'examples/audio_input/audio_input.cc', 322 ], 323 }, 324 { 325 'target_name': 'ppapi_example_file_chooser', 326 'dependencies': [ 327 'ppapi_example_skeleton', 328 'ppapi.gyp:ppapi_cpp', 329 ], 330 'sources': [ 331 'examples/file_chooser/file_chooser.cc', 332 ], 333 }, 334 { 335 'target_name': 'ppapi_example_graphics_2d', 336 'dependencies': [ 337 'ppapi_example_skeleton', 338 'ppapi.gyp:ppapi_c', 339 ], 340 'sources': [ 341 'examples/2d/graphics_2d_example.c', 342 ], 343 }, 344 { 345 'target_name': 'ppapi_example_ime', 346 'dependencies': [ 347 'ppapi_example_skeleton', 348 'ppapi.gyp:ppapi_cpp', 349 ], 350 'sources': [ 351 'examples/ime/ime.cc', 352 ], 353 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 354 'msvs_disabled_warnings': [ 4267, ], 355 }, 356 { 357 'target_name': 'ppapi_example_paint_manager', 358 'dependencies': [ 359 'ppapi_example_skeleton', 360 'ppapi.gyp:ppapi_cpp', 361 ], 362 'sources': [ 363 'examples/2d/paint_manager_example.cc', 364 ], 365 }, 366 { 367 'target_name': 'ppapi_example_input', 368 'dependencies': [ 369 'ppapi_example_skeleton', 370 'ppapi.gyp:ppapi_cpp', 371 ], 372 'sources': [ 373 'examples/input/pointer_event_input.cc', 374 ], 375 }, 376 { 377 'target_name': 'ppapi_example_post_message', 378 'dependencies': [ 379 'ppapi_example_skeleton', 380 'ppapi.gyp:ppapi_cpp', 381 ], 382 'sources': [ 383 'examples/scripting/post_message.cc', 384 ], 385 }, 386 { 387 'target_name': 'ppapi_example_scaling', 388 'dependencies': [ 389 'ppapi_example_skeleton', 390 'ppapi.gyp:ppapi_cpp', 391 ], 392 'sources': [ 393 'examples/scaling/scaling.cc', 394 ], 395 }, 396 { 397 'target_name': 'ppapi_example_scroll', 398 'dependencies': [ 399 'ppapi_example_skeleton', 400 'ppapi.gyp:ppapi_cpp', 401 ], 402 'sources': [ 403 'examples/2d/scroll.cc', 404 ], 405 }, 406 { 407 'target_name': 'ppapi_example_simple_font', 408 'dependencies': [ 409 'ppapi_example_skeleton', 410 'ppapi.gyp:ppapi_cpp', 411 ], 412 'sources': [ 413 'examples/font/simple_font.cc', 414 ], 415 }, 416 { 417 'target_name': 'ppapi_example_url_loader', 418 'dependencies': [ 419 'ppapi_example_skeleton', 420 'ppapi.gyp:ppapi_cpp', 421 ], 422 'sources': [ 423 'examples/url_loader/streaming.cc', 424 ], 425 }, 426 { 427 'target_name': 'ppapi_example_url_loader_file', 428 'dependencies': [ 429 'ppapi_example_skeleton', 430 'ppapi.gyp:ppapi_cpp', 431 ], 432 'sources': [ 433 'examples/url_loader/stream_to_file.cc', 434 ], 435 }, 436 { 437 'target_name': 'ppapi_example_gles2', 438 'dependencies': [ 439 'ppapi_example_skeleton', 440 'ppapi.gyp:ppapi_cpp', 441 'ppapi.gyp:ppapi_gles2', 442 ], 443 'include_dirs': [ 444 'lib/gl/include', 445 ], 446 'sources': [ 447 'examples/gles2/gles2.cc', 448 ], 449 }, 450 { 451 'target_name': 'ppapi_example_video_decode', 452 'dependencies': [ 453 'ppapi_example_skeleton', 454 'ppapi.gyp:ppapi_cpp', 455 'ppapi.gyp:ppapi_gles2', 456 ], 457 'include_dirs': [ 458 'lib/gl/include', 459 ], 460 'sources': [ 461 'examples/video_decode/video_decode.cc', 462 'examples/video_decode/testdata.h', 463 ], 464 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 465 'msvs_disabled_warnings': [ 4267, ], 466 }, 467 { 468 'target_name': 'ppapi_example_vc', 469 'dependencies': [ 470 'ppapi_example_skeleton', 471 'ppapi.gyp:ppapi_cpp', 472 'ppapi.gyp:ppapi_gles2', 473 ], 474 'include_dirs': [ 475 'lib/gl/include', 476 ], 477 'sources': [ 478 'examples/video_capture/video_capture.cc', 479 ], 480 }, 481 { 482 'target_name': 'ppapi_example_video_effects', 483 'dependencies': [ 484 'ppapi_example_skeleton', 485 'ppapi.gyp:ppapi_cpp', 486 ], 487 'sources': [ 488 'examples/video_effects/video_effects.cc', 489 ], 490 }, 491 { 492 'target_name': 'ppapi_example_enumerate_devices', 493 'dependencies': [ 494 'ppapi_example_skeleton', 495 'ppapi.gyp:ppapi_cpp', 496 ], 497 'sources': [ 498 'examples/enumerate_devices/enumerate_devices.cc', 499 ], 500 }, 501 { 502 'target_name': 'ppapi_example_flash_topmost', 503 'dependencies': [ 504 'ppapi_example_skeleton', 505 'ppapi.gyp:ppapi_cpp', 506 ], 507 'sources': [ 508 'examples/flash_topmost/flash_topmost.cc', 509 ], 510 }, 511 { 512 'target_name': 'ppapi_example_printing', 513 'dependencies': [ 514 'ppapi_example_skeleton', 515 'ppapi.gyp:ppapi_cpp', 516 ], 517 'sources': [ 518 'examples/printing/printing.cc', 519 ], 520 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 521 'msvs_disabled_warnings': [ 4267, ], 522 }, 523 ], 524 } 525