Http Cache: Include Content-length when serving HEAD requests from cached sparse...
[chromium-blink-merge.git] / components / domain_reliability / BUILD.gn
blob0f941a2123e77d5ec71600d7878f2918a9a15cf6
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") ],
15                                     "scope",
16                                     [ "baked_in_configs.gypi" ])
17 baked_in_configs =
18     rebase_path(baked_in_configs_gypi.baked_in_configs, "domain_reliability")
20 action("bake_in_configs") {
21   visibility = [ ":*" ]
22   script = "bake_in_configs.py"
24   inputs = baked_in_configs
25   outputs = [
26     "$target_gen_dir/baked_in_configs.cc",
27   ]
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") {
38   sources = [
39     "baked_in_configs.h",
40     "beacon.cc",
41     "beacon.h",
42     "clear_mode.h",
43     "config.cc",
44     "config.h",
45     "context.cc",
46     "context.h",
47     "dispatcher.cc",
48     "dispatcher.h",
49     "domain_reliability_export.h",
50     "monitor.cc",
51     "monitor.h",
52     "scheduler.cc",
53     "scheduler.h",
54     "service.cc",
55     "service.h",
56     "uploader.cc",
57     "uploader.h",
58     "util.cc",
59     "util.h",
60   ]
61   sources += get_target_outputs(":bake_in_configs")
63   defines = [ "DOMAIN_RELIABILITY_IMPLEMENTATION" ]
65   deps = [
66     ":bake_in_configs",
67     "//base",
68     "//components/keyed_service/core",
69     "//content/public/browser",
70     "//net",
71     "//url",
72   ]
75 source_set("unit_tests") {
76   testonly = true
77   sources = [
78     "config_unittest.cc",
79     "context_unittest.cc",
80     "dispatcher_unittest.cc",
81     "monitor_unittest.cc",
82     "scheduler_unittest.cc",
83     "test_util.cc",
84     "test_util.h",
85     "uploader_unittest.cc",
86     "util_unittest.cc",
87   ]
89   deps = [
90     ":domain_reliability",
91     "//base",
92     "//base/test:test_support",
93     "//net:test_support",
94     "//testing/gtest",
95   ]