Index: chrome/browser/permissions/permission_util_unittest.cc |
diff --git a/chrome/browser/permissions/permission_util_unittest.cc b/chrome/browser/permissions/permission_util_unittest.cc |
index def5eb91764dbbe6b4bcf1c1fedef2e8b0818ef3..41ef9699b7aa323cbfb20bfb5b51e1642b11a534 100644 |
--- a/chrome/browser/permissions/permission_util_unittest.cc |
+++ b/chrome/browser/permissions/permission_util_unittest.cc |
@@ -27,28 +27,48 @@ TEST_F(PermissionUtilTest, SetContentSettingRecordRevocation) { |
// Allow->Block triggers a revocation. |
map->SetContentSettingDefaultScope(host, host, type, std::string(), |
CONTENT_SETTING_ALLOW); |
- PermissionUtil::SetContentSettingAndRecordRevocation( |
- &profile, host, host, type, std::string(), CONTENT_SETTING_BLOCK); |
+ { |
+ PermissionUtil::RevocationReporter scoped_revocation_reporter( |
+ &profile, host, host, type, std::string(), |
+ PermissionSourceUI::SITE_SETTINGS); |
+ map->SetContentSettingDefaultScope(host, host, type, std::string(), |
+ CONTENT_SETTING_BLOCK); |
+ } |
histograms.ExpectBucketCount("Permissions.Action.Geolocation", |
PermissionAction::REVOKED, 1); |
// Block->Allow does not trigger a revocation. |
- PermissionUtil::SetContentSettingAndRecordRevocation( |
- &profile, host, host, type, std::string(), CONTENT_SETTING_ALLOW); |
+ { |
+ PermissionUtil::RevocationReporter scoped_revocation_reporter( |
raymes
2016/07/21 23:08:01
Calling the class ScopedRevocationReporter is actu
stefanocs
2016/07/22 00:44:28
Done.
|
+ &profile, host, host, type, std::string(), |
+ PermissionSourceUI::SITE_SETTINGS); |
+ map->SetContentSettingDefaultScope(host, host, type, std::string(), |
+ CONTENT_SETTING_ALLOW); |
+ } |
histograms.ExpectBucketCount("Permissions.Action.Geolocation", |
PermissionAction::REVOKED, 1); |
// Allow->Default triggers a revocation when default is 'ask'. |
map->SetDefaultContentSetting(type, CONTENT_SETTING_ASK); |
- PermissionUtil::SetContentSettingAndRecordRevocation( |
- &profile, host, host, type, std::string(), CONTENT_SETTING_DEFAULT); |
+ { |
+ PermissionUtil::RevocationReporter scoped_revocation_reporter( |
+ &profile, host, host, type, std::string(), |
+ PermissionSourceUI::SITE_SETTINGS); |
+ map->SetContentSettingDefaultScope(host, host, type, std::string(), |
+ CONTENT_SETTING_DEFAULT); |
+ } |
histograms.ExpectBucketCount("Permissions.Action.Geolocation", |
PermissionAction::REVOKED, 2); |
// Allow->Default does not trigger a revocation when default is 'allow'. |
map->SetDefaultContentSetting(type, CONTENT_SETTING_ALLOW); |
- PermissionUtil::SetContentSettingAndRecordRevocation( |
- &profile, host, host, type, std::string(), CONTENT_SETTING_DEFAULT); |
+ { |
+ PermissionUtil::RevocationReporter scoped_revocation_reporter( |
+ &profile, host, host, type, std::string(), |
+ PermissionSourceUI::SITE_SETTINGS); |
+ map->SetContentSettingDefaultScope(host, host, type, std::string(), |
+ CONTENT_SETTING_DEFAULT); |
raymes
2016/07/21 23:08:01
These tests don't exercise the new constructor. Bu
stefanocs
2016/07/22 00:44:28
Acknowledged.
|
+ } |
histograms.ExpectBucketCount("Permissions.Action.Geolocation", |
PermissionAction::REVOKED, 2); |
} |