| # Copyright 2023 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/config/chrome_build.gni") |
| import("//build/config/ozone.gni") |
| import("//build/config/ui.gni") |
| import("//testing/test.gni") |
| |
| source_set("headless") { |
| sources = [ |
| "headless_mode_switches.h", |
| "headless_mode_util.cc", |
| "headless_mode_util.h", |
| ] |
| |
| configs += [ "//build/config/compiler:wexit_time_destructors" ] |
| |
| deps = [ |
| "//base", |
| "//chrome/common:non_code_constants", |
| "//content/public/common", |
| "//ui/gfx", |
| ] |
| |
| if (is_linux) { |
| deps += [ |
| "//ui/gl", |
| "//ui/ozone", |
| ] |
| } |
| |
| if (is_win) { |
| deps += [ "//chrome/chrome_elf:chrome_elf_main_include" ] |
| } |
| } |
| |
| source_set("metrics") { |
| sources = [ |
| "headless_mode_metrics.cc", |
| "headless_mode_metrics.h", |
| ] |
| |
| configs += [ "//build/config/compiler:wexit_time_destructors" ] |
| |
| deps = [ |
| ":headless", |
| "//base", |
| "//components/headless/command_handler:switches", |
| "//content/public/browser", |
| ] |
| } |
| |
| if (!is_android) { |
| source_set("command_processor") { |
| sources = [ |
| "headless_command_processor.cc", |
| "headless_command_processor.h", |
| ] |
| |
| configs += [ "//build/config/compiler:wexit_time_destructors" ] |
| |
| deps = [ |
| ":headless", |
| "//base", |
| "//chrome/common:non_code_constants", |
| "//components/headless/command_handler", |
| "//components/keep_alive_registry", |
| "//content/public/browser", |
| ] |
| } |
| |
| source_set("browser_tests") { |
| testonly = true |
| defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] |
| |
| sources = [ |
| "headless_mode_browsertest.cc", |
| "headless_mode_browsertest.h", |
| ] |
| |
| if (is_linux || is_win || is_mac) { |
| sources += [ |
| "headless_mode_browsertest_utils.h", |
| "headless_mode_command_browsertest.cc", |
| "headless_mode_devtooled_browsertest.cc", |
| "headless_mode_devtooled_browsertest.h", |
| "headless_mode_protocol_browsertest.cc", |
| "headless_mode_protocol_browsertest.h", |
| "test/headless_browser_test_utils.cc", |
| "test/headless_browser_test_utils.h", |
| ] |
| } |
| |
| if (is_linux) { |
| sources += [ "headless_mode_browsertest_linux.cc" ] |
| } |
| |
| if (is_win) { |
| sources += [ "headless_mode_browsertest_win.cc" ] |
| } |
| |
| if (is_mac) { |
| sources += [ "headless_mode_browsertest_mac.mm" ] |
| } |
| |
| deps = [ |
| ":headless", |
| "//base", |
| "//chrome/browser", |
| "//chrome/browser/infobars", |
| "//chrome/test:test_support", |
| "//content/test:test_support", |
| "//pdf", |
| "//testing/gmock", |
| "//testing/gtest", |
| ] |
| |
| if (is_linux || is_win || is_mac) { |
| deps += [ |
| "//chrome/browser/infobars", |
| "//chrome/browser/profiles", |
| "//chrome/browser/ui", |
| "//chrome/browser/ui/views/frame:toolbar_button_provider", |
| "//components/devtools/simple_devtools_protocol_client", |
| "//components/headless/clipboard", |
| "//components/headless/command_handler", |
| "//components/headless/command_handler:switches", |
| "//components/headless/select_file_dialog", |
| "//components/headless/test", |
| "//components/headless/test:meta_info", |
| "//components/headless/test:shared_test", |
| "//components/infobars/content", |
| "//content/public/browser", |
| "//ui/display", |
| "//ui/gfx", |
| "//ui/views", |
| ] |
| } |
| |
| if (use_aura && is_win) { |
| deps += [ |
| "//ui/aura", |
| "//ui/aura:test_support", |
| ] |
| } |
| |
| if (use_ozone && is_linux) { |
| deps += [ "//ui/ozone" ] |
| } |
| |
| data = [ |
| "test/data/", |
| "//components/headless/test/data", |
| "//third_party/blink/web_tests/http/tests/inspector-protocol/resources/inspector-protocol-test.js", |
| "//third_party/blink/web_tests/http/tests/inspector-protocol/resources/http-interceptor.js", |
| ] |
| |
| # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and |
| # enable the diagnostic by removing this line. |
| configs += [ "//build/config/compiler:no_exit_time_destructors" ] |
| } |
| } |