| # Copyright 2020 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/config/chromeos/rules.gni") |
| import("//build/config/chromeos/ui_mode.gni") |
| import("//build/config/linux/gtk/gtk.gni") |
| import("//build/lacros/lacros_resource_sizes.gni") |
| |
| # Code lives in the lacros-chrome browser only, not ash-chrome. |
| assert(is_chromeos_lacros) |
| assert(!use_gtk) |
| |
| component("lacros") { |
| defines = [ "IS_CHROMEOS_LACROS_IMPL" ] |
| deps = [ |
| "//base", |
| "//build:chromeos_buildflags", |
| "//chromeos/crosapi/mojom", |
| "//chromeos/process_proxy", |
| "//chromeos/startup", |
| "//mojo/public/cpp/bindings", |
| ] |
| sources = [ |
| "lacros_chrome_service_delegate.h", |
| "lacros_chrome_service_impl.cc", |
| "lacros_chrome_service_impl.h", |
| ] |
| } |
| |
| lacros_resource_sizes_test("resource_sizes_lacros_chrome") { |
| data_deps = [ "//chrome:chrome" ] |
| } |
| |
| # "cros_board" set in the GN args defines the board used to build lacros-chrome, |
| # while the "override_board" here defines the board on which to test the built |
| # binary, for more details, please refer to the "generate_runner_script" |
| # template in //build/config/chromeos/rules.gni. |
| template("lacros_tast_test_helper") { |
| forward_variables_from(invoker, [ "override_board" ]) |
| assert(defined(override_board), "override_board is required") |
| lacros_tast_test(target_name) { |
| # TODO(crbug.com/1158590): use --attr-expr instead of hard-coding the tests. |
| # TODO(crbug.com/1174896): Re-enable lacros.ShelfLaunch once it's fixed and |
| # becomes stable. |
| tast_tests = [ |
| "lacros.AudioPlay", |
| "lacros.AppLauncherLaunch", |
| "lacros.Basic", |
| ] |
| } |
| } |
| |
| # On Chromium CI, only a very limited number of boards are supported: |
| # amd64-generic, eve, kevin etc, so just hard-coding them for simplicity. |
| if (is_chromeos_device) { |
| _boards = [ cros_board ] + string_split(cros_boards, ":") + |
| string_split(cros_boards_with_qemu_images, ":") |
| foreach(b1, |
| [ |
| "amd64-generic", |
| "eve", |
| ]) { |
| # To avoid duplicate definition of the targets. |
| matched = false |
| foreach(b2, _boards) { |
| if (!matched && b1 == b2) { |
| b1_underscore = string_replace(b1, "-", "_") |
| lacros_tast_test_helper("lacros_tast_tests_${b1_underscore}") { |
| override_board = b1 |
| } |
| matched = true |
| } |
| } |
| } |
| } |