Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / components / domain_reliability / BUILD.gn
blobfe1c23ca20c760b6e077643e9a71a85671061fb6
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     "context_manager.cc",
48     "context_manager.h",
49     "dispatcher.cc",
50     "dispatcher.h",
51     "domain_reliability_export.h",
52     "monitor.cc",
53     "monitor.h",
54     "scheduler.cc",
55     "scheduler.h",
56     "service.cc",
57     "service.h",
58     "uploader.cc",
59     "uploader.h",
60     "util.cc",
61     "util.h",
62   ]
63   sources += get_target_outputs(":bake_in_configs")
65   defines = [ "DOMAIN_RELIABILITY_IMPLEMENTATION" ]
67   deps = [
68     ":bake_in_configs",
69     "//base",
70     "//components/keyed_service/core",
71     "//content/public/browser",
72     "//net",
73     "//url",
74   ]
77 source_set("unit_tests") {
78   testonly = true
79   sources = [
80     "config_unittest.cc",
81     "context_unittest.cc",
82     "dispatcher_unittest.cc",
83     "monitor_unittest.cc",
84     "scheduler_unittest.cc",
85     "test_util.cc",
86     "test_util.h",
87     "uploader_unittest.cc",
88     "util_unittest.cc",
89   ]
91   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
93   deps = [
94     ":domain_reliability",
95     "//base",
96     "//base/test:test_support",
97     "//net:test_support",
98     "//testing/gtest",
99   ]