Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Unified Diff: components/autofill/core/browser/autofill_manager_unittest.cc

Issue 2737953002: UKM: Remove UkmService::RecordSource (Closed)
Patch Set: fix error from rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/autofill_manager_unittest.cc
diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc
index d33e0fe976df37725e3eb985ec7731eeb5ffa63a..dfa9bad84d3f6f987078a8c7644f26a55d5e161a 100644
--- a/components/autofill/core/browser/autofill_manager_unittest.cc
+++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -792,6 +792,15 @@ const ukm::Entry_Metric* FindMetric(
return nullptr;
}
+// Get Ukm sources from the Ukm service.
+std::vector<const ukm::UkmSource*> GetUkmSources(ukm::TestUkmService* service) {
+ std::vector<const ukm::UkmSource*> sources;
+ for (const auto& kv : service->GetSources())
+ sources.push_back(kv.second.get());
+
+ return sources;
+}
+
} // namespace
class AutofillManagerTest : public testing::Test {
@@ -1026,7 +1035,7 @@ class AutofillManagerTest : public testing::Test {
// Check that one source is logged.
ASSERT_EQ(1U, ukm_service->sources_count());
- const ukm::UkmSource* source = ukm_service->GetSource(0);
+ const ukm::UkmSource* source = GetUkmSources(ukm_service)[0];
// Check that one entry is logged.
EXPECT_EQ(1U, ukm_service->entries_count());

Powered by Google App Engine
This is Rietveld 408576698