OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//third_party/protobuf/proto_library.gni") | 5 import("//third_party/protobuf/proto_library.gni") |
6 | 6 |
7 # These values are duplicated in the GYP build in: | 7 # These values are duplicated in the GYP build in: |
8 # //components/precache/precache_defines.gypi | 8 # //components/precache/precache_defines.gypi |
9 precache_config_settings_url = | 9 precache_config_settings_url = |
10 "http://www.gstatic.com/chrome/wifiprefetch/precache_config" | 10 "http://www.gstatic.com/chrome/wifiprefetch/precache_config" |
11 precache_manifest_url_prefix = | 11 precache_manifest_url_prefix = |
12 "http://www.gstatic.com/chrome/wifiprefetch/hosts/" | 12 "http://www.gstatic.com/chrome/wifiprefetch/hosts/" |
13 | 13 |
14 config("precache_config") { | 14 config("precache_config") { |
15 defines = [ | 15 defines = [ |
16 "PRECACHE_CONFIG_SETTINGS_URL=\"$precache_config_settings_url\"", | 16 "PRECACHE_CONFIG_SETTINGS_URL=\"$precache_config_settings_url\"", |
17 "PRECACHE_MANIFEST_URL_PREFIX=\"$precache_manifest_url_prefix\"", | 17 "PRECACHE_MANIFEST_URL_PREFIX=\"$precache_manifest_url_prefix\"", |
18 ] | 18 ] |
19 } | 19 } |
20 | 20 |
21 static_library("core") { | 21 source_set("core") { |
22 sources = [ | 22 sources = [ |
23 "precache_database.cc", | 23 "precache_database.cc", |
24 "precache_database.h", | 24 "precache_database.h", |
25 "precache_fetcher.cc", | 25 "precache_fetcher.cc", |
26 "precache_fetcher.h", | 26 "precache_fetcher.h", |
27 "precache_switches.cc", | 27 "precache_switches.cc", |
28 "precache_switches.h", | 28 "precache_switches.h", |
29 "precache_url_table.cc", | 29 "precache_url_table.cc", |
30 "precache_url_table.h", | 30 "precache_url_table.h", |
31 ] | 31 ] |
32 | 32 |
33 # Note the GYP build sets this as direct dependent settings, but this is | 33 # Note the GYP build sets this as direct dependent settings, but this is |
34 # only used to share the settings with the unit tests. Instead, we just | 34 # only used to share the settings with the unit tests. Instead, we just |
35 # set this config for the necessary targets manually. | 35 # set this config for the necessary targets manually. |
36 configs += [ ":precache_config" ] | 36 configs += [ ":precache_config" ] |
37 | 37 |
38 deps = [ | 38 deps = [ |
39 ":proto", | 39 ":proto", |
40 "//base", | 40 "//base", |
41 "//url", | 41 "//url", |
42 ] | 42 ] |
43 } | 43 } |
44 | 44 |
45 proto_library("proto") { | 45 proto_library("proto") { |
46 sources = [ | 46 sources = [ |
47 "proto/precache.proto", | 47 "proto/precache.proto", |
48 ] | 48 ] |
49 } | 49 } |
| 50 |
| 51 source_set("unit_tests") { |
| 52 testonly = true |
| 53 sources = [ |
| 54 "precache_database_unittest.cc", |
| 55 "precache_fetcher_unittest.cc", |
| 56 "precache_url_table_unittest.cc", |
| 57 ] |
| 58 deps = [ |
| 59 ":core", |
| 60 ":proto", |
| 61 "//testing/gmock", |
| 62 "//testing/gtest", |
| 63 ] |
| 64 } |
OLD | NEW |