Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: chrome/test/BUILD.gn

Issue 1145243006: Port chromevox build to GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@externs
Patch Set: Unshare some vars, add TODO for the rest. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/chrome_build.gni") 5 import("//build/config/chrome_build.gni")
6 import("//build/config/crypto.gni") 6 import("//build/config/crypto.gni")
7 import("//build/config/features.gni") 7 import("//build/config/features.gni")
8 import("//build/config/ui.gni") 8 import("//build/config/ui.gni")
9 import("//build/module_args/v8.gni") 9 import("//chrome/test/base/js2gtest.gni")
10 import("//testing/test.gni") 10 import("//testing/test.gni")
11 11
12 # This target exists to reference other test executables to bring these files 12 # This target exists to reference other test executables to bring these files
13 # into the build. 13 # into the build.
14 group("test") { 14 group("test") {
15 testonly = true 15 testonly = true
16 } 16 }
17 17
18 # GYP version: chrome/chrome_tests_unit.gypi:test_support_common 18 # GYP version: chrome/chrome_tests_unit.gypi:test_support_common
19 source_set("test_support") { 19 source_set("test_support") {
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 ] 483 ]
484 } 484 }
485 if (!is_chromeos) { 485 if (!is_chromeos) {
486 sources -= [ 486 sources -= [
487 "../browser/sync/test/integration/wifi_credentials_helper.cc", 487 "../browser/sync/test/integration/wifi_credentials_helper.cc",
488 "../browser/sync/test/integration/wifi_credentials_helper.h", 488 "../browser/sync/test/integration/wifi_credentials_helper.h",
489 ] 489 ]
490 } 490 }
491 } 491 }
492 492
493 template("js2gtest") {
494 assert(defined(invoker.test_type) &&
495 (invoker.test_type == "webui" || invoker.test_type == "unit"))
496 action_name = target_name + "_action"
497 source_set_name = target_name
498
499 action_foreach(action_name) {
500 testonly = true
501 visibility = [ ":$source_set_name" ]
502 script = "//tools/gypv8sh.py"
503
504 sources = invoker.sources
505
506 d8_path =
507 get_label_info("//v8:d8($host_toolchain)", "root_out_dir") + "/d8"
508 if (is_win) {
509 d8_path += ".exe"
510 }
511
512 input_js = [
513 "//chrome/third_party/mock4js/mock4js.js",
514 "//chrome/test/data/webui/test_api.js",
515 "//chrome/test/base/js2gtest.js",
516 ]
517 inputs = [ d8_path ] + input_js
518
519 outputs = [
520 "$target_gen_dir/{{source_name_part}}-gen.cc",
521 "$root_out_dir/test_data/{{source_root_relative_dir}}/{{source_file_part }}",
522 ]
523
524 args = [
525 # Need "./" for script to find binary (cur dir is not on path).
526 "./" + rebase_path(d8_path, root_build_dir),
527 ]
528 args += rebase_path(input_js, root_build_dir) + [ invoker.test_type ]
529 if (v8_use_external_startup_data) {
530 args += [ "--external=y" ]
531 } else {
532 args += [ "--external=n" ]
533 }
534 args += [
535 "{{source}}",
536 "{{source_root_relative_dir}}/{{source_file_part}}",
537 ]
538 args += rebase_path(outputs, root_build_dir)
539
540 deps = [
541 "//v8:d8($host_toolchain)",
542 ]
543 }
544
545 if (defined(invoker.extra_js_files)) {
546 copy_target_name = target_name + "_copy"
547 copy(copy_target_name) {
548 visibility = [ ":$source_set_name" ]
549 sources = invoker.extra_js_files
550 outputs = [
551 "$root_out_dir/test_data/{{source_root_relative_dir}}/{{source_file_pa rt}}",
552 ]
553 }
554 }
555 source_set(source_set_name) {
556 testonly = true
557 if (defined(invoker.visibility)) {
558 visibility = invoker.visibility
559 }
560 sources = get_target_outputs(":$action_name")
561 if (defined(invoker.defines)) {
562 defines = invoker.defines
563 }
564 deps = [
565 ":$action_name",
566
567 # The generator implicitly makes includes from these targets.
568 "//testing/gmock",
569 "//testing/gtest",
570 "//url",
571 ]
572 if (defined(invoker.deps)) {
573 deps += invoker.deps
574 }
575 if (defined(invoker.extra_js_files)) {
576 data_deps = [ ":$copy_target_name" ]
577 }
578 }
579 }
580
581 js2gtest("browser_tests_js_webui") { 493 js2gtest("browser_tests_js_webui") {
582 test_type = "webui" 494 test_type = "webui"
583 sources = rebase_path( 495 sources = rebase_path(
584 chrome_tests_gypi_values.chrome_browser_tests_webui_js_sources, 496 chrome_tests_gypi_values.chrome_browser_tests_webui_js_sources,
585 ".", 497 ".",
586 "//chrome") 498 "//chrome")
587 if (is_chrome_branded) { 499 if (is_chrome_branded) {
588 # crbug.com/230471 500 # crbug.com/230471
589 sources -= [ "data/webui/accessibility_audit_browsertest.js" ] 501 sources -= [ "data/webui/accessibility_audit_browsertest.js" ]
590 } 502 }
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1826 "//third_party/mojo/src/mojo/edk/system", 1738 "//third_party/mojo/src/mojo/edk/system",
1827 ] 1739 ]
1828 1740
1829 if (!is_android && use_ash) { 1741 if (!is_android && use_ash) {
1830 sources += 1742 sources +=
1831 rebase_path(unit_gypi_values.chrome_test_support_unit_ash_sources, 1743 rebase_path(unit_gypi_values.chrome_test_support_unit_ash_sources,
1832 ".", 1744 ".",
1833 "//chrome") 1745 "//chrome")
1834 } 1746 }
1835 } 1747 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698