From f3ef455ed7d1ee3dd4724ea4f5d762bb41e49eaf Mon Sep 17 00:00:00 2001 From: Joel Martinez Date: Tue, 6 Jun 2023 06:59:42 -0600 Subject: [PATCH] Requisite ukm changes to get it building (#548) Some necessary modifications to the UKM BUILD file to get it building as a dependency b/280094891 Change-Id: I8389265d918aed47fae7a6e89492cc6f4bcaade6 --- components/ukm/BUILD.gn | 83 ++++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 35 deletions(-) diff --git a/components/ukm/BUILD.gn b/components/ukm/BUILD.gn index 6bb842435508..0358b124bc94 100644 --- a/components/ukm/BUILD.gn +++ b/components/ukm/BUILD.gn @@ -2,7 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//testing/test.gni") +if (!use_cobalt_customizations) { + import("//testing/test.gni") +} # The Url-Keyed Metrics (UKM) service is responsible for gathering and # uploading reports that contain fine grained performance metrics including @@ -38,6 +40,14 @@ static_library("ukm") { "//components/variations", "//url", ] + + if (use_cobalt_customizations) { + public_deps -= [ + "//services/metrics/public/cpp:metrics_cpp", + "//services/metrics/public/cpp:ukm_builders", + "//services/metrics/public/mojom", + ] + } } # Helper library for observing signals that we need to clear any local data. @@ -79,40 +89,43 @@ static_library("test_support") { ] } -source_set("unit_tests") { - testonly = true - sources = [ - "observers/sync_disable_observer_unittest.cc", - "ukm_service_unittest.cc", - ] +# TODO(b/283275474): Re-enable as many tests as possible. +if (!use_cobalt_customizations) { + 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", - "//components/sync:test_support_driver", - "//components/sync_preferences:test_support", - "//components/variations", - "//net:test_support", - "//services/metrics/public/cpp:ukm_builders", - "//testing/gtest", - "//third_party/zlib/google:compression_utils", - "//url", - ] -} + deps = [ + ":observers", + ":test_support", + ":ukm", + "//base", + "//base/test:test_support", + "//components/metrics", + "//components/metrics:test_support", + "//components/prefs:test_support", + "//components/sync", + "//components/sync:test_support_driver", + "//components/sync_preferences:test_support", + "//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:test_support", - "//components/test:run_all_unittests", - ] + # Convenience testing target + test("ukm_unittests") { + deps = [ + ":unit_tests", + "//base", + "//base/test:test_support", + "//components/test:run_all_unittests", + ] + } }