Chromium Code Reviews| Index: chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc |
| diff --git a/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc b/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc |
| index a156676b83198c9e00233335f38ea5105fe7438f..3b869a210f4eb81ea37053c7797b2afe43a2abd6 100644 |
| --- a/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc |
| +++ b/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc |
| @@ -6,6 +6,7 @@ |
| #include <memory> |
| +#include "base/test/histogram_tester.h" |
| #include "chrome/browser/chrome_notification_types.h" |
| #include "chrome/browser/ui/webui/site_settings_helper.h" |
| #include "chrome/test/base/testing_profile.h" |
| @@ -260,8 +261,14 @@ TEST_F(SiteSettingsHandlerTest, Origins) { |
| setArgs.AppendString("notifications"); |
| setArgs.AppendString("block"); |
| setArgs.AppendBoolean(false); // Incognito. |
| + base::HistogramTester histograms; |
| handler()->HandleSetCategoryPermissionForOrigin(&setArgs); |
| EXPECT_EQ(1U, web_ui()->call_data().size()); |
| + const std::string kUmaBase("WebsiteSettings.Menu.PermissionChanged"); |
| + histograms.ExpectTotalCount(kUmaBase, 1); |
| + histograms.ExpectTotalCount(kUmaBase + ".Allowed", 0); |
| + histograms.ExpectTotalCount(kUmaBase + ".Blocked", 1); |
| + histograms.ExpectTotalCount(kUmaBase + ".Reset", 0); |
| // Verify the change was successful. |
| base::ListValue listArgs; |
| @@ -278,6 +285,10 @@ TEST_F(SiteSettingsHandlerTest, Origins) { |
| resetArgs.AppendBoolean(false); // Incognito. |
| handler()->HandleResetCategoryPermissionForOrigin(&resetArgs); |
| EXPECT_EQ(3U, web_ui()->call_data().size()); |
| + histograms.ExpectTotalCount(kUmaBase, 2); // Including the "block" above. |
|
Dan Beam
2017/05/05 01:40:48
nit: you could just make a new scope
{
base::Hi
dschuyler
2017/05/05 21:21:35
Done.
|
| + histograms.ExpectTotalCount(kUmaBase + ".Allowed", 0); |
| + histograms.ExpectTotalCount(kUmaBase + ".Blocked", 1); |
| + histograms.ExpectTotalCount(kUmaBase + ".Reset", 1); |
| // Verify the reset was successful. |
| handler()->HandleGetExceptionList(&listArgs); |