# Copyright 2014 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. # Paths to the JSON files are kind of gross. They're stored in the gypi # relative to //components, since that's the working directory gyp seems # to use for all of the components. When we depend on them here, we need # to remove the leading domain_reliability, since *our* working directory # is one level deeper. When we call bake_in_configs.py, we need to give # it a properly-rebased path to //components so it can properly join the # paths relative to that and find the JSON files. baked_in_configs_gypi = exec_script("//build/gypi_to_gn.py", [ rebase_path("baked_in_configs.gypi") ], "scope", [ "baked_in_configs.gypi" ]) baked_in_configs = rebase_path(baked_in_configs_gypi.baked_in_configs, "domain_reliability") action("bake_in_configs") { visibility = [ ":*" ] script = "bake_in_configs.py" inputs = baked_in_configs outputs = [ "$target_gen_dir/baked_in_configs.cc", ] # The actual list of JSON files will overflow the command line length limit # on Windows, so pass the name of the .gypi file and bake_in_configs.py will # read the filenames out of it manually. args = [ rebase_path("//components", root_build_dir) ] + [ rebase_path("baked_in_configs.gypi", root_build_dir) ] + rebase_path(outputs, root_build_dir) } component("domain_reliability") { sources = [ "baked_in_configs.h", "beacon.cc", "beacon.h", "clear_mode.h", "config.cc", "config.h", "context.cc", "context.h", "dispatcher.cc", "dispatcher.h", "domain_reliability_export.h", "monitor.cc", "monitor.h", "scheduler.cc", "scheduler.h", "service.cc", "service.h", "uploader.cc", "uploader.h", "util.cc", "util.h", ] sources += get_target_outputs(":bake_in_configs") defines = [ "DOMAIN_RELIABILITY_IMPLEMENTATION" ] deps = [ ":bake_in_configs", "//base", "//components/keyed_service/core", "//content/public/browser", "//net", "//url", ] } source_set("unit_tests") { testonly = true sources = [ "config_unittest.cc", "context_unittest.cc", "dispatcher_unittest.cc", "monitor_unittest.cc", "scheduler_unittest.cc", "test_util.cc", "test_util.h", "uploader_unittest.cc", "util_unittest.cc", ] deps = [ ":domain_reliability", "//base", "//base/test:test_support", "//net:test_support", "//testing/gtest", ] }