Upload upstream chromium 114.0.5735.31
[platform/framework/web/chromium-efl.git] / components / ukm / BUILD.gn
1 # Copyright 2017 The Chromium Authors
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import("//testing/test.gni")
6
7 component("ukm_recorder") {
8   output_name = "ukm_recorder"
9
10   defines = [ "IS_UKM_RECORDER_IMPL" ]
11
12   friend = [
13     ":test_support",
14     ":unit_tests",
15   ]
16
17   sources = [
18     "scheme_constants.cc",
19     "scheme_constants.h",
20     "ukm_consent_state.h",
21     "ukm_entry_filter.h",
22     "ukm_recorder_impl.cc",
23     "ukm_recorder_impl.h",
24     "ukm_recorder_observer.cc",
25     "ukm_recorder_observer.h",
26   ]
27
28   deps = [
29     "//base",
30     "//components/variations",
31     "//services/metrics/public/cpp:metrics_cpp",
32     "//services/metrics/public/cpp:ukm_builders",
33     "//services/metrics/public/mojom",
34     "//third_party/metrics_proto",
35     "//url",
36   ]
37 }
38
39 # The Url-Keyed Metrics (UKM) service is responsible for gathering and
40 # uploading reports that contain fine grained performance metrics including
41 # URLs for top-level navigations.
42 static_library("ukm") {
43   sources = [
44     "app_source_url_recorder.cc",
45     "app_source_url_recorder.h",
46     "field_trials_provider_helper.cc",
47     "field_trials_provider_helper.h",
48     "ukm_pref_names.cc",
49     "ukm_pref_names.h",
50     "ukm_reporting_service.cc",
51     "ukm_reporting_service.h",
52     "ukm_rotation_scheduler.cc",
53     "ukm_rotation_scheduler.h",
54     "ukm_service.cc",
55     "ukm_service.h",
56     "unsent_log_store_metrics_impl.cc",
57     "unsent_log_store_metrics_impl.h",
58   ]
59
60   public_deps = [
61     ":ukm_recorder",
62     "//services/metrics/public/cpp:metrics_cpp",
63     "//services/metrics/public/cpp:ukm_builders",
64     "//services/metrics/public/mojom",
65     "//third_party/metrics_proto",
66   ]
67
68   deps = [
69     "//base",
70     "//components/crx_file",
71     "//components/metrics",
72     "//components/prefs",
73     "//components/variations",
74     "//url",
75   ]
76   if (is_ios) {
77     deps += [ "//components/ukm/ios:ukm_reporting_ios_util" ]
78   }
79 }
80
81 # Helper library for observing signals that we need to clear any local data.
82 static_library("observers") {
83   sources = [
84     "observers/history_delete_observer.cc",
85     "observers/history_delete_observer.h",
86     "observers/ukm_consent_state_observer.cc",
87     "observers/ukm_consent_state_observer.h",
88     "ukm_consent_state.h",
89   ]
90
91   deps = [
92     "//base",
93     "//components/history/core/browser",
94     "//components/metrics",
95     "//components/sync/base",
96     "//components/sync/driver",
97     "//google_apis",
98     "//services/metrics/public/cpp:metrics_cpp",
99   ]
100
101   public_deps = [ "//components/unified_consent" ]
102 }
103
104 static_library("test_support") {
105   testonly = true
106   sources = [
107     "test_ukm_recorder.cc",
108     "test_ukm_recorder.h",
109   ]
110
111   public_deps = [
112     ":ukm",
113     "//third_party/metrics_proto",
114   ]
115   deps = [
116     "//base",
117     "//components/metrics:test_support",
118     "//components/prefs:test_support",
119     "//testing/gtest:gtest",
120   ]
121 }
122
123 source_set("unit_tests") {
124   testonly = true
125   sources = [
126     "app_source_url_recorder_test.cc",
127     "observers/ukm_consent_state_observer_unittest.cc",
128     "ukm_recorder_impl_unittest.cc",
129     "ukm_service_unittest.cc",
130   ]
131
132   deps = [
133     ":observers",
134     ":test_support",
135     ":ukm",
136     "//base",
137     "//base/test:test_support",
138     "//components/metrics",
139     "//components/metrics:test_support",
140     "//components/prefs:test_support",
141     "//components/sync:test_support",
142     "//components/sync_preferences:test_support",
143     "//components/variations",
144     "//net:test_support",
145     "//services/metrics",
146     "//services/metrics/public/cpp:ukm_builders",
147     "//testing/gtest",
148     "//third_party/zlib/google:compression_utils",
149     "//url",
150   ]
151 }
152
153 # Convenience testing target
154 test("ukm_unittests") {
155   deps = [
156     ":unit_tests",
157     "//base",
158     "//base/test:test_support",
159     "//components/test:run_all_unittests",
160   ]
161 }
162
163 static_library("ukm_test_helper") {
164   testonly = true
165   sources = [
166     "ukm_test_helper.cc",
167     "ukm_test_helper.h",
168   ]
169   deps = [
170     ":ukm",
171     "//base",
172     "//components/metrics",
173     "//services/metrics/public/cpp:metrics_cpp",
174     "//third_party/metrics_proto",
175   ]
176 }