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

Unified Diff: components/ukm/ukm_service_unittest.cc

Issue 2855053002: Allow empty UKM entries to be recorded. (Closed)
Patch Set: Fix test Created 3 years, 8 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
« no previous file with comments | « components/ukm/ukm_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ukm/ukm_service_unittest.cc
diff --git a/components/ukm/ukm_service_unittest.cc b/components/ukm/ukm_service_unittest.cc
index b17286e5a9d7bdea6f236d9e2f8e560368573341..6177f7c345d4b1279f0cfde4e14464075d95b5b4 100644
--- a/components/ukm/ukm_service_unittest.cc
+++ b/components/ukm/ukm_service_unittest.cc
@@ -259,7 +259,7 @@ TEST_F(UkmServiceTest, EntryBuilderAndSerialization) {
EXPECT_EQ(10, proto_entry_foo_end.value());
}
-TEST_F(UkmServiceTest, AddEntryOnlyWithNonEmptyMetrics) {
+TEST_F(UkmServiceTest, AddEntryWithEmptyMetrics) {
UkmService service(&prefs_, &client_);
EXPECT_EQ(0, GetPersistedLogCount());
service.Initialize();
@@ -277,17 +277,7 @@ TEST_F(UkmServiceTest, AddEntryOnlyWithNonEmptyMetrics) {
service.Flush();
EXPECT_EQ(1, GetPersistedLogCount());
Report proto_report = GetPersistedReport();
- EXPECT_EQ(0, proto_report.entries_size());
-
- {
- std::unique_ptr<UkmEntryBuilder> builder =
- service.GetEntryBuilder(id, "PageLoad");
- builder->AddMetric("FirstContentfulPaint", 300);
- }
- service.Flush();
- EXPECT_EQ(2, GetPersistedLogCount());
- Report proto_report_with_entries = GetPersistedReport();
- EXPECT_EQ(1, proto_report_with_entries.entries_size());
+ EXPECT_EQ(1, proto_report.entries_size());
}
TEST_F(UkmServiceTest, MetricsProviderTest) {
« no previous file with comments | « components/ukm/ukm_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698