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

Side by Side Diff: chrome/browser/permissions/permission_context_base_unittest.cc

Issue 2651123002: Migrate content setting PROMPT_NO_DECISION_COUNT to PERMISSION_AUTOBLOCKER_DATA (Closed)
Patch Set: Rename pref 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_decision_auto_blocker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/permissions/permission_context_base.h" 5 #include "chrome/browser/permissions/permission_context_base.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 EXPECT_EQ(CONTENT_SETTING_ASK, permission_context.decisions()[0]); 410 EXPECT_EQ(CONTENT_SETTING_ASK, permission_context.decisions()[0]);
411 EXPECT_TRUE(permission_context.tab_context_updated()); 411 EXPECT_TRUE(permission_context.tab_context_updated());
412 EXPECT_EQ(CONTENT_SETTING_ASK, 412 EXPECT_EQ(CONTENT_SETTING_ASK,
413 permission_context.GetContentSettingFromMap(url, url)); 413 permission_context.GetContentSettingFromMap(url, url));
414 } 414 }
415 415
416 // Flush the dismissal counts. Enable the block on too many dismissals 416 // Flush the dismissal counts. Enable the block on too many dismissals
417 // feature, which is disabled by default. 417 // feature, which is disabled by default.
418 auto* map = HostContentSettingsMapFactory::GetForProfile(profile()); 418 auto* map = HostContentSettingsMapFactory::GetForProfile(profile());
419 map->ClearSettingsForOneType( 419 map->ClearSettingsForOneType(
420 CONTENT_SETTINGS_TYPE_PROMPT_NO_DECISION_COUNT); 420 CONTENT_SETTINGS_TYPE_PERMISSION_AUTOBLOCKER_DATA);
421 421
422 base::test::ScopedFeatureList feature_list; 422 base::test::ScopedFeatureList feature_list;
423 feature_list.InitAndEnableFeature(features::kBlockPromptsIfDismissedOften); 423 feature_list.InitAndEnableFeature(features::kBlockPromptsIfDismissedOften);
424 424
425 EXPECT_TRUE( 425 EXPECT_TRUE(
426 base::FeatureList::IsEnabled(features::kBlockPromptsIfDismissedOften)); 426 base::FeatureList::IsEnabled(features::kBlockPromptsIfDismissedOften));
427 427
428 // Sanity check independence per permission type by checking two of them. 428 // Sanity check independence per permission type by checking two of them.
429 DismissMultipleTimesAndExpectBlock(url, 429 DismissMultipleTimesAndExpectBlock(url,
430 content::PermissionType::GEOLOCATION, 430 content::PermissionType::GEOLOCATION,
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 TEST_F(PermissionContextBaseTests, TestPermissionsBlacklistingAllowed) { 851 TEST_F(PermissionContextBaseTests, TestPermissionsBlacklistingAllowed) {
852 scoped_refptr<MockSafeBrowsingDatabaseManager> db_manager = 852 scoped_refptr<MockSafeBrowsingDatabaseManager> db_manager =
853 new MockSafeBrowsingDatabaseManager(true /* perform_callback */); 853 new MockSafeBrowsingDatabaseManager(true /* perform_callback */);
854 const GURL url("https://www.example.com"); 854 const GURL url("https://www.example.com");
855 std::set<std::string> blacklisted_permissions{"GEOLOCATION"}; 855 std::set<std::string> blacklisted_permissions{"GEOLOCATION"};
856 db_manager->BlacklistUrlPermissions(url, blacklisted_permissions); 856 db_manager->BlacklistUrlPermissions(url, blacklisted_permissions);
857 TestPermissionsBlacklisting(content::PermissionType::NOTIFICATIONS, 857 TestPermissionsBlacklisting(content::PermissionType::NOTIFICATIONS,
858 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, db_manager, 858 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, db_manager,
859 url, 2000 /* timeout */, CONTENT_SETTING_ALLOW); 859 url, 2000 /* timeout */, CONTENT_SETTING_ALLOW);
860 } 860 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_decision_auto_blocker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698