| # Copyright 2014 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/buildflag_header.gni") |
| import("//build/config/chromeos/rules.gni") |
| import("//build/config/ui.gni") |
| import("//testing/libfuzzer/fuzzer_test.gni") |
| import("//testing/test.gni") |
| import("//third_party/protobuf/proto_library.gni") |
| |
| assert(is_chromeos, "Non-Chrome-OS builds must not depend on //chromeos") |
| |
| # Used by targets that compile into the implementation. |
| config("chromeos_implementation") { |
| defines = [ "CHROMEOS_IMPLEMENTATION" ] |
| } |
| |
| declare_args() { |
| # Defines a buildflag for ease of iteration on the print team's |
| # PpdProvider class. |
| # TODO(crbug.com/1025995): remove this and all related scaffolding |
| # once we're ready to cut over. |
| is_printing_ppd_provider_v3 = false |
| } |
| |
| buildflag_header("chromeos_buildflags") { |
| header = "chromeos_buildflags.h" |
| flags = [ "IS_CHROMEOS_DEVICE=$is_chromeos_device" ] |
| } |
| |
| component("chromeos") { |
| configs += [ |
| ":chromeos_implementation", |
| "//build/config/linux/nss:system_nss_no_ssl_config", |
| ] |
| if (is_chromeos_device) { |
| configs += [ "//build/config/compiler:use_orderfile_for_hugepage" ] |
| } |
| public_deps = [ "//chromeos/constants" ] |
| deps = [ |
| ":chromeos_export", |
| "//base", |
| "//base:i18n", |
| "//chromeos/dbus", |
| "//chromeos/dbus/constants", |
| "//components/policy/proto", |
| "//google_apis", |
| "//services/network/public/cpp:cpp", |
| "//third_party/protobuf:protobuf_lite", |
| ] |
| sources = [ |
| "hugepage_text/hugepage_text.cc", |
| "hugepage_text/hugepage_text.h", |
| "policy/weekly_time/time_utils.cc", |
| "policy/weekly_time/time_utils.h", |
| "policy/weekly_time/weekly_time.cc", |
| "policy/weekly_time/weekly_time.h", |
| "policy/weekly_time/weekly_time_interval.cc", |
| "policy/weekly_time/weekly_time_interval.h", |
| "printing/cups_printer_status.cc", |
| "printing/cups_printer_status.h", |
| "printing/epson_driver_matching.cc", |
| "printing/epson_driver_matching.h", |
| "printing/ppd_cache.cc", |
| "printing/ppd_cache.h", |
| "printing/ppd_line_reader.cc", |
| "printing/ppd_line_reader.h", |
| "printing/ppd_provider.h", |
| "printing/printer_configuration.cc", |
| "printing/printer_configuration.h", |
| "printing/printer_translator.cc", |
| "printing/printer_translator.h", |
| "printing/uri.cc", |
| "printing/uri.h", |
| "printing/uri_components.cc", |
| "printing/uri_components.h", |
| "printing/uri_impl.cc", |
| "printing/uri_impl.h", |
| "printing/usb_printer_id.cc", |
| "printing/usb_printer_id.h", |
| "process_proxy/process_output_watcher.cc", |
| "process_proxy/process_output_watcher.h", |
| "process_proxy/process_proxy.cc", |
| "process_proxy/process_proxy.h", |
| "process_proxy/process_proxy_registry.cc", |
| "process_proxy/process_proxy_registry.h", |
| ] |
| if (current_cpu == "arm" || current_cpu == "x86") { |
| defines = [ "BINDER_IPC_32BIT" ] |
| } |
| |
| if (is_printing_ppd_provider_v3) { |
| sources += [ |
| "printing/ppd_metadata_parser.cc", |
| "printing/ppd_metadata_parser.h", |
| "printing/ppd_provider_v3.cc", |
| "printing/printer_config_cache.cc", |
| "printing/printer_config_cache.h", |
| ] |
| } else { |
| sources += [ "printing/ppd_provider.cc" ] |
| } |
| } |
| |
| source_set("chromeos_export") { |
| deps = [ "//base" ] |
| sources = [ "chromeos_export.h" ] |
| } |
| |
| # This must be a static library instead of a source set because some of the |
| # files pull in things with dependencies that aren't linked in all cases. |
| # |
| # TODO this should probably be changed such that it links in all cases and |
| # can be converted to a source set. |
| static_library("test_support") { |
| testonly = true |
| public_deps = [ ":test_support_source_set" ] |
| } |
| |
| source_set("test_support_source_set") { |
| testonly = true |
| public_deps = [ |
| ":chromeos", |
| ":test_utils", |
| ] |
| deps = [ |
| "//chromeos/attestation:test_support", |
| "//chromeos/cryptohome:test_support", |
| "//chromeos/dbus:test_support", |
| "//chromeos/disks:test_support", |
| "//chromeos/login/auth:test_support", |
| "//chromeos/login/login_state:test_support", |
| "//chromeos/network:test_support", |
| "//chromeos/tpm:test_support", |
| "//google_apis", |
| "//net:test_support", |
| "//services/network:test_support", |
| "//testing/gmock", |
| "//testing/gtest", |
| ] |
| } |
| |
| source_set("test_utils") { |
| deps = [ "//base" ] |
| sources = [ |
| "test/chromeos_test_utils.cc", |
| "test/chromeos_test_utils.h", |
| ] |
| } |
| |
| test("chromeos_unittests") { |
| configs += [ |
| "//build/config/linux/dbus", |
| "//build/config/linux/nss:system_nss_no_ssl_config", |
| ] |
| deps = [ |
| ":chromeos_buildflags", |
| ":test_support", |
| "//base/test:test_support", |
| "//chromeos/attestation:unit_tests", |
| "//chromeos/audio:unit_tests", |
| "//chromeos/cryptohome:unit_tests", |
| "//chromeos/dbus:test_support", |
| "//chromeos/dbus:unit_tests", |
| "//chromeos/dbus/services:unit_tests", |
| "//chromeos/disks:unit_tests", |
| "//chromeos/geolocation:unit_tests", |
| "//chromeos/login/auth:unit_tests", |
| "//chromeos/login/login_state:unit_tests", |
| "//chromeos/login/session:unit_tests", |
| "//chromeos/memory:unit_tests", |
| "//chromeos/network:test_support", |
| "//chromeos/network:unit_tests", |
| "//chromeos/services:unit_tests", |
| "//chromeos/settings:unit_tests", |
| "//chromeos/system:unit_tests", |
| "//chromeos/timezone:unit_tests", |
| "//chromeos/tpm:unit_tests", |
| "//components/onc", |
| "//components/policy:generated", |
| "//components/policy/proto", |
| "//components/prefs:test_support", |
| "//components/proxy_config", |
| "//crypto", |
| "//crypto:platform", |
| "//dbus:test_support", |
| "//google_apis", |
| "//mojo/core/embedder", |
| "//net", |
| "//net:test_support", |
| "//services/network:test_support", |
| "//services/network/public/cpp", |
| "//testing/gmock", |
| "//testing/gtest", |
| "//third_party/icu", |
| "//url", |
| ] |
| sources = [ |
| "policy/weekly_time/time_utils_unittest.cc", |
| "policy/weekly_time/weekly_time_interval_unittest.cc", |
| "policy/weekly_time/weekly_time_unittest.cc", |
| "printing/cups_printer_status_unittest.cc", |
| "printing/epson_driver_matching_unittest.cc", |
| "printing/ppd_cache_unittest.cc", |
| "printing/ppd_line_reader_unittest.cc", |
| "printing/printer_configuration_unittest.cc", |
| "printing/printer_translator_unittest.cc", |
| "printing/uri_unittest.cc", |
| "printing/uri_unittest.h", |
| "printing/uri_unittest_consistency.cc", |
| "printing/usb_printer_id_unittest.cc", |
| "process_proxy/process_output_watcher_unittest.cc", |
| "process_proxy/process_proxy_unittest.cc", |
| "test/run_all_unittests.cc", |
| ] |
| |
| if (is_printing_ppd_provider_v3) { |
| sources += [ |
| "printing/fake_printer_config_cache.cc", |
| "printing/fake_printer_config_cache.h", |
| "printing/ppd_metadata_parser_unittest.cc", |
| "printing/printer_config_cache_unittest.cc", |
| ] |
| } else { |
| sources += [ "printing/ppd_provider_unittest.cc" ] |
| } |
| |
| data = [ "test/data/" ] |
| } |
| |
| # The following definitions only apply when building for a CrOS board (ie: not |
| # linux-chromeos). See the following for reference: |
| # https://chromium.googlesource.com/chromium/src/+/master/docs/chromeos_build_instructions.md |
| # https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md |
| if (is_chromeos_device) { |
| # This builds a tool that prepares a DUT or VM for testing, which can be |
| # utilized by wrapping a host-side script test. |
| generate_runner_script("cros_test_wrapper") { |
| generated_script = "$root_build_dir/bin/cros_test_wrapper" |
| |
| # Assume every time we build cros_test_wrapper, we also build chrome and |
| # want to deploy it to the DUT. |
| deploy_chrome = true |
| } |
| |
| # The sanity test's actual binary is baked into the OS image. All we need to |
| # do is build the test wrapper and build our own browser to push to the DUT |
| # before testing it. |
| generate_runner_script("cros_browser_sanity_test") { |
| testonly = true |
| test_exe = "cros_browser_sanity_test" |
| generated_script = "$root_build_dir/bin/run_cros_browser_sanity_test" |
| runtime_deps_file = "$root_out_dir/cros_browser_sanity_test.runtime_deps" |
| |
| data_deps = [ |
| ":cros_chrome_deploy", |
| "//:chromiumos_preflight", # Builds the browser. |
| ] |
| } |
| |
| tast_test("chrome_login_tast_tests") { |
| tast_tests = [ |
| "ui.ChromeLogin", |
| "ui.ChromeCrashLoggedIn", |
| "ui.ChromeCrashNotLoggedIn", |
| ] |
| } |
| |
| # Used to report the size of various partitions. For more details, see: |
| # https://source.chromium.org/search?q=report_disk_usage.go |
| tast_test("disk_usage_tast_test") { |
| tast_tests = [ "platform.ReportDiskUsage" ] |
| } |
| |
| # Tast test sources live in the Chromium OS repository. |
| # To diagnose tast failures or disable tests, see go/tast-failures |
| tast_test("chrome_all_tast_tests") { |
| # To disable a specific test, add it the following list and cite a bug. |
| tast_disabled_tests = [ |
| # crbug.com/1097630 |
| "security.OpenFDs", |
| |
| # crbug.com/1051059 |
| "security.SELinuxProcessesARC", |
| |
| # crbug.com/1062289 |
| "security.NetworkListenersARC", |
| "security.NetworkListenersNonARC", |
| |
| # crbug.com/1056163 |
| "hwsec.LoginGuest", |
| |
| # crbug.com/1059426 |
| "ui.ChromeCrashNotLoggedInDirect.breakpad", |
| "ui.ChromeCrashLoggedInDirect.breakpad", |
| |
| # crbug.com/1073084 |
| "crostini.CopyPaste.wayland_to_x11_artifact", |
| |
| # crbug.com/1098810 |
| "security.SELinuxFilesSystem", |
| ] |
| } |
| |
| tast_test("chrome_all_tast_tests_informational") { |
| enable_tast_informational_tests = true |
| } |
| |
| group("cros_chrome_deploy") { |
| # The following run-time dependencies are needed to deploy chrome to a |
| # ChromeOS device. See the link for the full list: |
| # https://codesearch.chromium.org/chromium/src/third_party/chromite/lib/chrome_util.py?l=341 |
| # Most of these are copy targets, for which GN doesn't add their outputs |
| # as runtime-deps. See the link below for more details: |
| # https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/reference.md#actions-and-copies |
| data_deps = [ |
| "//chrome:xdg_mime", |
| "//mojo/core:shared_library_arc32", |
| "//mojo/core:shared_library_arc64", |
| ] |
| |
| # TODO(bpastene): Figure out what's generating resources/chromeos/ and |
| # declare it as a dep instead of adding the dir directly. |
| data = [ "$root_out_dir/resources/chromeos/" ] |
| } |
| } |
| |
| fuzzer_test("ppd_line_reader_fuzzer") { |
| sources = [ "printing/ppd_line_reader_fuzzer.cc" ] |
| deps = [ ":chromeos" ] |
| } |
| |
| fuzzer_test("printer_configuration_fuzzer") { |
| sources = [ "printing/printer_configuration_fuzzer.cc" ] |
| seed_corpus = "printing/uri_fuzzer_seed_corpus" |
| deps = [ |
| ":chromeos", |
| "//base", |
| ] |
| } |
| |
| fuzzer_test("uri_fuzzer") { |
| sources = [ "printing/uri_fuzzer.cc" ] |
| seed_corpus = "printing/uri_fuzzer_seed_corpus" |
| deps = [ ":chromeos" ] |
| } |