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
3 # found in the LICENSE file.
5 # Paths to the JSON files are kind of gross. They're stored in the gypi
6 # relative to //components, since that's the working directory gyp seems
7 # to use for all of the components. When we depend on them here, we need
8 # to remove the leading domain_reliability, since *our* working directory
9 # is one level deeper. When we call bake_in_configs.py, we need to give
10 # it a properly-rebased path to //components so it can properly join the
11 # paths relative to that and find the JSON files.
13 baked_in_configs_gypi = exec_script("//build/gypi_to_gn.py",
14 [ rebase_path("baked_in_configs.gypi") ],
16 [ "baked_in_configs.gypi" ])
18 rebase_path(baked_in_configs_gypi.baked_in_configs, "domain_reliability")
20 action("bake_in_configs") {
22 script = "bake_in_configs.py"
24 inputs = baked_in_configs
26 "$target_gen_dir/baked_in_configs.cc",
29 # The actual list of JSON files will overflow the command line length limit
30 # on Windows, so pass the name of the .gypi file and bake_in_configs.py will
31 # read the filenames out of it manually.
32 args = [ rebase_path("//components", root_build_dir) ] +
33 [ rebase_path("baked_in_configs.gypi", root_build_dir) ] +
34 rebase_path(outputs, root_build_dir)
37 component("domain_reliability") {
51 "domain_reliability_export.h",
63 sources += get_target_outputs(":bake_in_configs")
65 defines = [ "DOMAIN_RELIABILITY_IMPLEMENTATION" ]
70 "//components/keyed_service/core",
71 "//content/public/browser",
77 source_set("unit_tests") {
81 "context_unittest.cc",
82 "dispatcher_unittest.cc",
83 "monitor_unittest.cc",
84 "scheduler_unittest.cc",
87 "uploader_unittest.cc",
91 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
94 ":domain_reliability",
96 "//base/test:test_support",