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

Unified Diff: chrome/browser/permissions/permission_decision_auto_blocker_unittest.cc

Issue 2715643002: Replace all enums with enum classes in permissions code. (Closed)
Patch Set: Rebase Created 3 years, 10 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
Index: chrome/browser/permissions/permission_decision_auto_blocker_unittest.cc
diff --git a/chrome/browser/permissions/permission_decision_auto_blocker_unittest.cc b/chrome/browser/permissions/permission_decision_auto_blocker_unittest.cc
index 777c0ad040b9b6eacfdf79cc67b9512030bb6861..e62eebb311866c64f25fb678d187034dc6c8854e 100644
--- a/chrome/browser/permissions/permission_decision_auto_blocker_unittest.cc
+++ b/chrome/browser/permissions/permission_decision_auto_blocker_unittest.cc
@@ -279,8 +279,9 @@ TEST_F(PermissionDecisionAutoBlockerUnitTest, TestUpdateEmbargoBlacklist) {
CheckSafeBrowsingBlacklist(url, CONTENT_SETTINGS_TYPE_GEOLOCATION);
EXPECT_TRUE(callback_was_run());
EXPECT_TRUE(last_embargoed_status());
- histograms.ExpectUniqueSample("Permissions.AutoBlocker.SafeBrowsingResponse",
- SafeBrowsingResponse::BLACKLISTED, 1);
+ histograms.ExpectUniqueSample(
+ "Permissions.AutoBlocker.SafeBrowsingResponse",
+ static_cast<int>(SafeBrowsingResponse::BLACKLISTED), 1);
histograms.ExpectTotalCount(
"Permissions.AutoBlocker.SafeBrowsingResponseTime", 1);
}
@@ -302,8 +303,9 @@ TEST_F(PermissionDecisionAutoBlockerUnitTest, TestRequestNotBlacklisted) {
CheckSafeBrowsingBlacklist(url, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
EXPECT_FALSE(last_embargoed_status());
- histograms.ExpectUniqueSample("Permissions.AutoBlocker.SafeBrowsingResponse",
- SafeBrowsingResponse::NOT_BLACKLISTED, 1);
+ histograms.ExpectUniqueSample(
+ "Permissions.AutoBlocker.SafeBrowsingResponse",
+ static_cast<int>(SafeBrowsingResponse::NOT_BLACKLISTED), 1);
histograms.ExpectTotalCount(
"Permissions.AutoBlocker.SafeBrowsingResponseTime", 1);
}
@@ -489,7 +491,8 @@ TEST_F(PermissionDecisionAutoBlockerUnitTest, TestSafeBrowsingTimeout) {
EXPECT_EQ(PermissionStatusSource::UNSPECIFIED, result.source);
histograms.ExpectUniqueSample("Permissions.AutoBlocker.SafeBrowsingResponse",
- SafeBrowsingResponse::TIMEOUT, 1);
+ static_cast<int>(SafeBrowsingResponse::TIMEOUT),
+ 1);
histograms.ExpectTotalCount(
"Permissions.AutoBlocker.SafeBrowsingResponseTime", 1);
db_manager->SetPerformCallback(true);
@@ -504,8 +507,9 @@ TEST_F(PermissionDecisionAutoBlockerUnitTest, TestSafeBrowsingTimeout) {
2);
histograms.ExpectTotalCount(
"Permissions.AutoBlocker.SafeBrowsingResponseTime", 2);
- histograms.ExpectBucketCount("Permissions.AutoBlocker.SafeBrowsingResponse",
- SafeBrowsingResponse::BLACKLISTED, 1);
+ histograms.ExpectBucketCount(
+ "Permissions.AutoBlocker.SafeBrowsingResponse",
+ static_cast<int>(SafeBrowsingResponse::BLACKLISTED), 1);
clock()->Advance(base::TimeDelta::FromDays(1));
result =
autoblocker()->GetEmbargoResult(url, CONTENT_SETTINGS_TYPE_GEOLOCATION);
@@ -616,6 +620,7 @@ TEST_F(PermissionDecisionAutoBlockerUnitTest, TestSafeBrowsingResponse) {
CheckSafeBrowsingBlacklist(url, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
EXPECT_FALSE(last_embargoed_status());
- histograms.ExpectUniqueSample("Permissions.AutoBlocker.SafeBrowsingResponse",
- SafeBrowsingResponse::NOT_BLACKLISTED, 1);
+ histograms.ExpectUniqueSample(
+ "Permissions.AutoBlocker.SafeBrowsingResponse",
+ static_cast<int>(SafeBrowsingResponse::NOT_BLACKLISTED), 1);
}

Powered by Google App Engine
This is Rietveld 408576698