summaryrefslogtreecommitdiff
path: root/chromium/components/ukm/BUILD.gn
blob: 6dbee54fc868546bddbc0db19522629af5d248b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Copyright 2017 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.

import("//testing/test.gni")

# The Url-Keyed Metrics (UKM) service is responsible for gathering and
# uploading reports that contain fine grained performance metrics including
# URLs for top-level navigations.
static_library("ukm") {
  sources = [
    "persisted_logs_metrics_impl.cc",
    "persisted_logs_metrics_impl.h",
    "ukm_pref_names.cc",
    "ukm_pref_names.h",
    "ukm_recorder_impl.cc",
    "ukm_recorder_impl.h",
    "ukm_reporting_service.cc",
    "ukm_reporting_service.h",
    "ukm_rotation_scheduler.cc",
    "ukm_rotation_scheduler.h",
    "ukm_service.cc",
    "ukm_service.h",
    "ukm_source.cc",
    "ukm_source.h",
  ]

  public_deps = [
    "//components/metrics/proto",
    "//services/metrics/public/cpp:metrics_cpp",
    "//services/metrics/public/interfaces",
  ]

  deps = [
    "//base",
    "//components/data_use_measurement/core",
    "//components/metrics",
    "//components/prefs",
    "//components/variations",
    "//url",
  ]
}

static_library("ukm_interface") {
  sources = [
    "ukm_interface.cc",
    "ukm_interface.h",
  ]

  public_deps = [
    "//base",
    "//services/metrics/public/interfaces",
  ]

  deps = [
    ":ukm",
    "//mojo/public/cpp/bindings",
  ]
}

# Helper library for observing signals that we need to clear any local data.
static_library("observers") {
  sources = [
    "observers/history_delete_observer.cc",
    "observers/history_delete_observer.h",
    "observers/sync_disable_observer.cc",
    "observers/sync_disable_observer.h",
  ]

  deps = [
    "//base",
    "//components/history/core/browser",
    "//components/sync",
  ]
}

static_library("test_support") {
  testonly = true
  sources = [
    "test_ukm_recorder.cc",
    "test_ukm_recorder.h",
  ]

  public_deps = [
    ":ukm",
    "//components/metrics/proto",
  ]
  deps = [
    "//base",
    "//components/metrics:test_support",
    "//components/prefs:test_support",
    "//testing/gtest:gtest",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "observers/sync_disable_observer_unittest.cc",
    "ukm_service_unittest.cc",
  ]

  deps = [
    ":observers",
    ":test_support",
    ":ukm",
    "//base",
    "//base/test:test_support",
    "//components/metrics",
    "//components/metrics:test_support",
    "//components/prefs:test_support",
    "//components/sync:test_support_driver",
    "//components/variations",
    "//net:test_support",
    "//services/metrics/public/cpp:ukm_builders",
    "//testing/gtest",
    "//third_party/zlib/google:compression_utils",
    "//url",
  ]
}

# Convenience testing target
test("ukm_unittests") {
  deps = [
    ":unit_tests",
    "//base",
    "//base/test:run_all_unittests",
    "//base/test:test_support",
  ]
}