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

Unified Diff: base/test/histogram_tester_unittest.cc

Issue 2628843002: Match only prefixes of histogram names. (Closed)
Patch Set: Add expectation. Created 3 years, 11 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
« base/test/histogram_tester.cc ('K') | « base/test/histogram_tester.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/histogram_tester_unittest.cc
diff --git a/base/test/histogram_tester_unittest.cc b/base/test/histogram_tester_unittest.cc
index f896eaa3e89357abda627fee1d2f9d4b9fb52c0e..9ce39b9ac05711d05c661e646fe70f8da964848c 100644
--- a/base/test/histogram_tester_unittest.cc
+++ b/base/test/histogram_tester_unittest.cc
@@ -21,7 +21,7 @@ const char kHistogram2[] = "Test2";
const char kHistogram3[] = "Test3";
const char kHistogram4[] = "Test4";
const char kHistogram5[] = "Test5";
-const char kHistogramSuffix[] = "Test4.Test5";
+const char kHistogramSuffix[] = "Test4.Test5.Test6";
} // namespace
@@ -118,12 +118,14 @@ TEST_F(HistogramTesterTest, TestGetAllSamples_NoSamples) {
EXPECT_THAT(tester.GetAllSamples(kHistogram5), IsEmpty());
}
-// Wrong behaviour for GetTotalCountForPrefix: https://crbug.com/659977
-TEST_F(HistogramTesterTest, DISABLED_TestGetTotalCountsForPrefix) {
+TEST_F(HistogramTesterTest, TestGetTotalCountsForPrefix) {
HistogramTester tester;
UMA_HISTOGRAM_ENUMERATION(kHistogramSuffix, 2, 5);
Ilya Sherman 2017/01/12 20:32:41 Optional nit: I think it would be clearer to inlin
pkalinnikov 2017/01/13 10:28:59 Done.
- EXPECT_TRUE(tester.GetTotalCountsForPrefix("Test5").empty());
+ // Regression check for bug https://crbug.com/659977.
+ EXPECT_TRUE(tester.GetTotalCountsForPrefix("Test5.").empty());
+
+ EXPECT_EQ(1u, tester.GetTotalCountsForPrefix("Test4.").size());
}
} // namespace base
« base/test/histogram_tester.cc ('K') | « base/test/histogram_tester.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698