BUILD.gn 3.9 KB

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