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

Unified Diff: components/favicon/core/large_icon_service_unittest.cc

Issue 2809783003: [LargeIconService] Report size of favicon for fallback style to UMA (Closed)
Patch Set: Ilya's comment #3 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/favicon/core/large_icon_service.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/favicon/core/large_icon_service_unittest.cc
diff --git a/components/favicon/core/large_icon_service_unittest.cc b/components/favicon/core/large_icon_service_unittest.cc
index bc27de15fcc73460292c985a7950a6aae7b22473..d5cabcb48fac46d8a79b418371093f98c841e627 100644
--- a/components/favicon/core/large_icon_service_unittest.cc
+++ b/components/favicon/core/large_icon_service_unittest.cc
@@ -399,6 +399,8 @@ TEST_P(LargeIconServiceGetterTest, FallbackSinceIconTooSmall) {
GetLargeIconOrFallbackStyleAndWaitForCallback(GURL(kDummyUrl), 24, 24);
EXPECT_EQ(nullptr, returned_bitmap_size_);
EXPECT_TRUE(HasBackgroundColor(*returned_fallback_style_, kTestColor));
+ histogram_tester_.ExpectUniqueSample("Favicons.LargeIconService.FallbackSize",
+ 16, /*expected_count=*/1);
}
TEST_P(LargeIconServiceGetterTest, FallbackSinceIconNotSquare) {
@@ -406,6 +408,8 @@ TEST_P(LargeIconServiceGetterTest, FallbackSinceIconNotSquare) {
GetLargeIconOrFallbackStyleAndWaitForCallback(GURL(kDummyUrl), 24, 24);
EXPECT_EQ(nullptr, returned_bitmap_size_);
EXPECT_TRUE(HasBackgroundColor(*returned_fallback_style_, kTestColor));
+ histogram_tester_.ExpectUniqueSample("Favicons.LargeIconService.FallbackSize",
+ 24, /*expected_count=*/1);
}
TEST_P(LargeIconServiceGetterTest, FallbackSinceIconMissing) {
@@ -413,6 +417,8 @@ TEST_P(LargeIconServiceGetterTest, FallbackSinceIconMissing) {
GetLargeIconOrFallbackStyleAndWaitForCallback(GURL(kDummyUrl), 24, 24);
EXPECT_EQ(nullptr, returned_bitmap_size_);
EXPECT_TRUE(returned_fallback_style_->is_default_background_color);
+ histogram_tester_.ExpectUniqueSample("Favicons.LargeIconService.FallbackSize",
+ 0, /*expected_count=*/1);
}
TEST_P(LargeIconServiceGetterTest, FallbackSinceIconMissingNoScale) {
@@ -420,6 +426,8 @@ TEST_P(LargeIconServiceGetterTest, FallbackSinceIconMissingNoScale) {
GetLargeIconOrFallbackStyleAndWaitForCallback(GURL(kDummyUrl), 24, 0);
EXPECT_EQ(nullptr, returned_bitmap_size_);
EXPECT_TRUE(returned_fallback_style_->is_default_background_color);
+ histogram_tester_.ExpectUniqueSample("Favicons.LargeIconService.FallbackSize",
+ 0, /*expected_count=*/1);
}
// Oddball case where we demand a high resolution icon to scale down. Generates
@@ -429,6 +437,8 @@ TEST_P(LargeIconServiceGetterTest, FallbackSinceTooPicky) {
GetLargeIconOrFallbackStyleAndWaitForCallback(GURL(kDummyUrl), 32, 24);
EXPECT_EQ(nullptr, returned_bitmap_size_);
EXPECT_TRUE(HasBackgroundColor(*returned_fallback_style_, kTestColor));
+ histogram_tester_.ExpectUniqueSample("Favicons.LargeIconService.FallbackSize",
+ 24, /*expected_count=*/1);
}
// Every test will appear with suffix /0 (param false) and /1 (param true), e.g.
« no previous file with comments | « components/favicon/core/large_icon_service.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698