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

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: . Created 3 years, 11 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
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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 EXPECT_EQ(CONTENT_SETTING_ASK, permission_context.decisions()[0]); 396 EXPECT_EQ(CONTENT_SETTING_ASK, permission_context.decisions()[0]);
397 EXPECT_TRUE(permission_context.tab_context_updated()); 397 EXPECT_TRUE(permission_context.tab_context_updated());
398 EXPECT_EQ(CONTENT_SETTING_ASK, 398 EXPECT_EQ(CONTENT_SETTING_ASK,
399 permission_context.GetContentSettingFromMap(url, url)); 399 permission_context.GetContentSettingFromMap(url, url));
400 } 400 }
401 401
402 // Flush the dismissal counts. Enable the block on too many dismissals 402 // Flush the dismissal counts. Enable the block on too many dismissals
403 // feature, which is disabled by default. 403 // feature, which is disabled by default.
404 auto* map = HostContentSettingsMapFactory::GetForProfile(profile()); 404 auto* map = HostContentSettingsMapFactory::GetForProfile(profile());
405 map->ClearSettingsForOneType( 405 map->ClearSettingsForOneType(
406 CONTENT_SETTINGS_TYPE_PROMPT_NO_DECISION_COUNT); 406 CONTENT_SETTINGS_TYPE_PERMISSION_AUTOBLOCKER_DATA);
407 407
408 base::test::ScopedFeatureList feature_list; 408 base::test::ScopedFeatureList feature_list;
409 feature_list.InitAndEnableFeature(features::kBlockPromptsIfDismissedOften); 409 feature_list.InitAndEnableFeature(features::kBlockPromptsIfDismissedOften);
410 410
411 EXPECT_TRUE( 411 EXPECT_TRUE(
412 base::FeatureList::IsEnabled(features::kBlockPromptsIfDismissedOften)); 412 base::FeatureList::IsEnabled(features::kBlockPromptsIfDismissedOften));
413 413
414 // Sanity check independence per permission type by checking two of them. 414 // Sanity check independence per permission type by checking two of them.
415 DismissMultipleTimesAndExpectBlock(url, 415 DismissMultipleTimesAndExpectBlock(url,
416 content::PermissionType::GEOLOCATION, 416 content::PermissionType::GEOLOCATION,
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 new MockSafeBrowsingDatabaseManager(false /* perform_callback */); 850 new MockSafeBrowsingDatabaseManager(false /* perform_callback */);
851 const GURL url("https://www.example.com"); 851 const GURL url("https://www.example.com");
852 std::set<std::string> blacklisted_permissions{ 852 std::set<std::string> blacklisted_permissions{
853 PermissionUtil::GetPermissionString( 853 PermissionUtil::GetPermissionString(
854 content::PermissionType::GEOLOCATION)}; 854 content::PermissionType::GEOLOCATION)};
855 db_manager->BlacklistUrlPermissions(url, blacklisted_permissions); 855 db_manager->BlacklistUrlPermissions(url, blacklisted_permissions);
856 TestPermissionsBlacklisting(content::PermissionType::GEOLOCATION, 856 TestPermissionsBlacklisting(content::PermissionType::GEOLOCATION,
857 CONTENT_SETTINGS_TYPE_GEOLOCATION, db_manager, 857 CONTENT_SETTINGS_TYPE_GEOLOCATION, db_manager,
858 url, 0 /* timeout in ms */, CONTENT_SETTING_ASK); 858 url, 0 /* timeout in ms */, CONTENT_SETTING_ASK);
859 } 859 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698