| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/ntp_tiles/metrics.h" | 5 #include "components/ntp_tiles/metrics.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 base::Bucket(/*min=*/ICON_COLOR, /*count=*/3), | 65 base::Bucket(/*min=*/ICON_COLOR, /*count=*/3), |
| 66 base::Bucket(/*min=*/ICON_DEFAULT, /*count=*/1))); | 66 base::Bucket(/*min=*/ICON_DEFAULT, /*count=*/1))); |
| 67 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.TileType.server"), | 67 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.TileType.server"), |
| 68 ElementsAre(base::Bucket(/*min=*/ICON_REAL, /*count=*/1), | 68 ElementsAre(base::Bucket(/*min=*/ICON_REAL, /*count=*/1), |
| 69 base::Bucket(/*min=*/ICON_DEFAULT, /*count=*/1))); | 69 base::Bucket(/*min=*/ICON_DEFAULT, /*count=*/1))); |
| 70 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.TileType.client"), | 70 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.TileType.client"), |
| 71 ElementsAre(base::Bucket(/*min=*/ICON_REAL, /*count=*/3), | 71 ElementsAre(base::Bucket(/*min=*/ICON_REAL, /*count=*/3), |
| 72 base::Bucket(/*min=*/ICON_COLOR, /*count=*/2))); | 72 base::Bucket(/*min=*/ICON_COLOR, /*count=*/2))); |
| 73 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.TileType.popular"), | 73 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.TileType.popular"), |
| 74 ElementsAre(base::Bucket(/*min=*/ICON_COLOR, /*count=*/1))); | 74 ElementsAre(base::Bucket(/*min=*/ICON_COLOR, /*count=*/1))); |
| 75 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.IconsReal"), | |
| 76 ElementsAre(base::Bucket(/*min=*/4, /*count=*/1))); | |
| 77 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.IconsColor"), | |
| 78 ElementsAre(base::Bucket(/*min=*/3, /*count=*/1))); | |
| 79 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.IconsGray"), | |
| 80 ElementsAre(base::Bucket(/*min=*/1, /*count=*/1))); | |
| 81 EXPECT_THAT(histogram_tester.GetAllSamples( | 75 EXPECT_THAT(histogram_tester.GetAllSamples( |
| 82 "NewTabPage.SuggestionsImpression.IconsReal"), | 76 "NewTabPage.SuggestionsImpression.IconsReal"), |
| 83 ElementsAre(base::Bucket(/*min=*/0, /*count=*/1), | 77 ElementsAre(base::Bucket(/*min=*/0, /*count=*/1), |
| 84 base::Bucket(/*min=*/1, /*count=*/1), | 78 base::Bucket(/*min=*/1, /*count=*/1), |
| 85 base::Bucket(/*min=*/2, /*count=*/1), | 79 base::Bucket(/*min=*/2, /*count=*/1), |
| 86 base::Bucket(/*min=*/5, /*count=*/1))); | 80 base::Bucket(/*min=*/5, /*count=*/1))); |
| 87 EXPECT_THAT(histogram_tester.GetAllSamples( | 81 EXPECT_THAT(histogram_tester.GetAllSamples( |
| 88 "NewTabPage.SuggestionsImpression.IconsColor"), | 82 "NewTabPage.SuggestionsImpression.IconsColor"), |
| 89 ElementsAre(base::Bucket(/*min=*/3, /*count=*/1), | 83 ElementsAre(base::Bucket(/*min=*/3, /*count=*/1), |
| 90 base::Bucket(/*min=*/4, /*count=*/1), | 84 base::Bucket(/*min=*/4, /*count=*/1), |
| (...skipping 25 matching lines...) Expand all Loading... |
| 116 EXPECT_THAT(histogram_tester.GetAllSamples( | 110 EXPECT_THAT(histogram_tester.GetAllSamples( |
| 117 "NewTabPage.SuggestionsImpression.popular"), | 111 "NewTabPage.SuggestionsImpression.popular"), |
| 118 ElementsAre(base::Bucket(/*min=*/2, /*count=*/1))); | 112 ElementsAre(base::Bucket(/*min=*/2, /*count=*/1))); |
| 119 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.TileType"), IsEmpty()); | 113 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.TileType"), IsEmpty()); |
| 120 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.TileType.server"), | 114 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.TileType.server"), |
| 121 IsEmpty()); | 115 IsEmpty()); |
| 122 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.TileType.client"), | 116 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.TileType.client"), |
| 123 IsEmpty()); | 117 IsEmpty()); |
| 124 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.TileType.popular"), | 118 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.TileType.popular"), |
| 125 IsEmpty()); | 119 IsEmpty()); |
| 126 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.IconsReal"), | |
| 127 IsEmpty()); | |
| 128 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.IconsColor"), | |
| 129 IsEmpty()); | |
| 130 EXPECT_THAT(histogram_tester.GetAllSamples("NewTabPage.IconsGray"), | |
| 131 IsEmpty()); | |
| 132 EXPECT_THAT(histogram_tester.GetAllSamples( | 120 EXPECT_THAT(histogram_tester.GetAllSamples( |
| 133 "NewTabPage.SuggestionsImpression.IconsReal"), | 121 "NewTabPage.SuggestionsImpression.IconsReal"), |
| 134 IsEmpty()); | 122 IsEmpty()); |
| 135 EXPECT_THAT(histogram_tester.GetAllSamples( | 123 EXPECT_THAT(histogram_tester.GetAllSamples( |
| 136 "NewTabPage.SuggestionsImpression.IconsColor"), | 124 "NewTabPage.SuggestionsImpression.IconsColor"), |
| 137 IsEmpty()); | 125 IsEmpty()); |
| 138 EXPECT_THAT(histogram_tester.GetAllSamples( | 126 EXPECT_THAT(histogram_tester.GetAllSamples( |
| 139 "NewTabPage.SuggestionsImpression.IconsGray"), | 127 "NewTabPage.SuggestionsImpression.IconsGray"), |
| 140 IsEmpty()); | 128 IsEmpty()); |
| 141 } | 129 } |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 EXPECT_TRUE(rappor_service.GetRecordedSampleForMetric( | 199 EXPECT_TRUE(rappor_service.GetRecordedSampleForMetric( |
| 212 "NTP.SuggestionsImpressions.IconsGray", &sample, &type)); | 200 "NTP.SuggestionsImpressions.IconsGray", &sample, &type)); |
| 213 EXPECT_EQ("site3.com", sample); | 201 EXPECT_EQ("site3.com", sample); |
| 214 EXPECT_EQ(rappor::ETLD_PLUS_ONE_RAPPOR_TYPE, type); | 202 EXPECT_EQ(rappor::ETLD_PLUS_ONE_RAPPOR_TYPE, type); |
| 215 } | 203 } |
| 216 } | 204 } |
| 217 | 205 |
| 218 } // namespace | 206 } // namespace |
| 219 } // namespace metrics | 207 } // namespace metrics |
| 220 } // namespace ntp_tiles | 208 } // namespace ntp_tiles |
| OLD | NEW |