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

Unified Diff: chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc

Issue 2790493002: Implement permissions embargo for prompts which are repeatedly ignored. (Closed)
Patch Set: Not for plugins Created 3 years, 9 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 | « no previous file | chrome/browser/permissions/permission_context_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc
index 709249b028c59d0d423476f0f91e6a9a25409e7c..9b26180312a80bf44653210c5dd9f2fee490453b 100644
--- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc
+++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc
@@ -584,8 +584,8 @@ class RemovePermissionPromptCountsTest {
return autoblocker_->GetIgnoreCount(url, permission);
}
- int RecordIgnore(const GURL& url, ContentSettingsType permission) {
- return autoblocker_->RecordIgnore(url, permission);
+ bool RecordIgnoreAndEmbargo(const GURL& url, ContentSettingsType permission) {
+ return autoblocker_->RecordIgnoreAndEmbargo(url, permission);
}
bool RecordDismissAndEmbargo(const GURL& url,
@@ -1677,16 +1677,16 @@ TEST_F(ChromeBrowsingDataRemoverDelegateTest, ClearPermissionPromptCounts) {
{
// Test REMOVE_HISTORY.
- EXPECT_EQ(1, tester.RecordIgnore(kOrigin1,
- CONTENT_SETTINGS_TYPE_GEOLOCATION));
- EXPECT_EQ(2, tester.RecordIgnore(kOrigin1,
- CONTENT_SETTINGS_TYPE_GEOLOCATION));
- EXPECT_EQ(1, tester.RecordIgnore(kOrigin1,
- CONTENT_SETTINGS_TYPE_NOTIFICATIONS));
+ EXPECT_FALSE(tester.RecordIgnoreAndEmbargo(
+ kOrigin1, CONTENT_SETTINGS_TYPE_GEOLOCATION));
+ EXPECT_FALSE(tester.RecordIgnoreAndEmbargo(
+ kOrigin1, CONTENT_SETTINGS_TYPE_GEOLOCATION));
+ EXPECT_FALSE(tester.RecordIgnoreAndEmbargo(
+ kOrigin1, CONTENT_SETTINGS_TYPE_NOTIFICATIONS));
EXPECT_FALSE(tester.RecordDismissAndEmbargo(
kOrigin1, CONTENT_SETTINGS_TYPE_MIDI_SYSEX));
- EXPECT_EQ(1, tester.RecordIgnore(kOrigin2,
- CONTENT_SETTINGS_TYPE_DURABLE_STORAGE));
+ EXPECT_FALSE(tester.RecordIgnoreAndEmbargo(
+ kOrigin2, CONTENT_SETTINGS_TYPE_DURABLE_STORAGE));
tester.CheckEmbargo(kOrigin2, CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
CONTENT_SETTING_ASK);
EXPECT_FALSE(tester.RecordDismissAndEmbargo(
@@ -1737,18 +1737,18 @@ TEST_F(ChromeBrowsingDataRemoverDelegateTest, ClearPermissionPromptCounts) {
}
{
// Test REMOVE_SITE_DATA.
- EXPECT_EQ(1, tester.RecordIgnore(kOrigin1,
- CONTENT_SETTINGS_TYPE_GEOLOCATION));
- EXPECT_EQ(2, tester.RecordIgnore(kOrigin1,
- CONTENT_SETTINGS_TYPE_GEOLOCATION));
- EXPECT_EQ(1, tester.RecordIgnore(kOrigin1,
- CONTENT_SETTINGS_TYPE_NOTIFICATIONS));
+ EXPECT_FALSE(tester.RecordIgnoreAndEmbargo(
+ kOrigin1, CONTENT_SETTINGS_TYPE_GEOLOCATION));
+ EXPECT_FALSE(tester.RecordIgnoreAndEmbargo(
+ kOrigin1, CONTENT_SETTINGS_TYPE_GEOLOCATION));
+ EXPECT_FALSE(tester.RecordIgnoreAndEmbargo(
+ kOrigin1, CONTENT_SETTINGS_TYPE_NOTIFICATIONS));
EXPECT_FALSE(tester.RecordDismissAndEmbargo(
kOrigin1, CONTENT_SETTINGS_TYPE_MIDI_SYSEX));
tester.CheckEmbargo(kOrigin1, CONTENT_SETTINGS_TYPE_MIDI_SYSEX,
CONTENT_SETTING_ASK);
- EXPECT_EQ(1, tester.RecordIgnore(kOrigin2,
- CONTENT_SETTINGS_TYPE_DURABLE_STORAGE));
+ EXPECT_FALSE(tester.RecordIgnoreAndEmbargo(
+ kOrigin2, CONTENT_SETTINGS_TYPE_DURABLE_STORAGE));
EXPECT_FALSE(tester.RecordDismissAndEmbargo(
kOrigin2, CONTENT_SETTINGS_TYPE_NOTIFICATIONS));
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_context_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698