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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_remover_unittest.cc

Issue 2386193004: Make all PermissionDecisionAutoBlocker methods static. (Closed)
Patch Set: Address comments Created 4 years, 2 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_context_base.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browsing_data/browsing_data_remover.h" 5 #include "chrome/browser/browsing_data/browsing_data_remover.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 1030
1031 private: 1031 private:
1032 password_manager::MockPasswordStore* store_; 1032 password_manager::MockPasswordStore* store_;
1033 1033
1034 DISALLOW_COPY_AND_ASSIGN(RemovePasswordsTester); 1034 DISALLOW_COPY_AND_ASSIGN(RemovePasswordsTester);
1035 }; 1035 };
1036 1036
1037 class RemovePermissionPromptCountsTest { 1037 class RemovePermissionPromptCountsTest {
1038 public: 1038 public:
1039 explicit RemovePermissionPromptCountsTest(TestingProfile* profile) 1039 explicit RemovePermissionPromptCountsTest(TestingProfile* profile)
1040 : blocker_(new PermissionDecisionAutoBlocker(profile)), 1040 : profile_(profile) {}
1041 profile_(profile) {}
1042 1041
1043 int GetDismissCount(const GURL& url, content::PermissionType permission) { 1042 int GetDismissCount(const GURL& url, content::PermissionType permission) {
1044 return PermissionDecisionAutoBlocker::GetDismissCount( 1043 return PermissionDecisionAutoBlocker::GetDismissCount(
1045 url, permission, profile_); 1044 url, permission, profile_);
1046 } 1045 }
1047 1046
1048 int GetIgnoreCount(const GURL& url, content::PermissionType permission) { 1047 int GetIgnoreCount(const GURL& url, content::PermissionType permission) {
1049 return PermissionDecisionAutoBlocker::GetIgnoreCount( 1048 return PermissionDecisionAutoBlocker::GetIgnoreCount(
1050 url, permission, profile_); 1049 url, permission, profile_);
1051 } 1050 }
1052 1051
1053 int RecordIgnore(const GURL& url, content::PermissionType permission) { 1052 int RecordIgnore(const GURL& url, content::PermissionType permission) {
1054 return blocker_->RecordIgnore(url, permission); 1053 return PermissionDecisionAutoBlocker::RecordIgnore(url, permission,
1054 profile_);
1055 } 1055 }
1056 1056
1057 bool ShouldChangeDismissalToBlock(const GURL& url, 1057 bool ShouldChangeDismissalToBlock(const GURL& url,
1058 content::PermissionType permission) { 1058 content::PermissionType permission) {
1059 return blocker_->ShouldChangeDismissalToBlock(url, permission); 1059 return PermissionDecisionAutoBlocker::ShouldChangeDismissalToBlock(
1060 url, permission, profile_);
1060 } 1061 }
1061 1062
1062 private: 1063 private:
1063 std::unique_ptr<PermissionDecisionAutoBlocker> blocker_;
1064 TestingProfile* profile_; 1064 TestingProfile* profile_;
1065 1065
1066 DISALLOW_COPY_AND_ASSIGN(RemovePermissionPromptCountsTest); 1066 DISALLOW_COPY_AND_ASSIGN(RemovePermissionPromptCountsTest);
1067 }; 1067 };
1068 1068
1069 #if defined(ENABLE_PLUGINS) 1069 #if defined(ENABLE_PLUGINS)
1070 // A small modification to MockBrowsingDataFlashLSOHelper so that it responds 1070 // A small modification to MockBrowsingDataFlashLSOHelper so that it responds
1071 // immediately and does not wait for the Notify() call. Otherwise it would 1071 // immediately and does not wait for the Notify() call. Otherwise it would
1072 // deadlock BrowsingDataRemover::RemoveImpl. 1072 // deadlock BrowsingDataRemover::RemoveImpl.
1073 class TestBrowsingDataFlashLSOHelper : public MockBrowsingDataFlashLSOHelper { 1073 class TestBrowsingDataFlashLSOHelper : public MockBrowsingDataFlashLSOHelper {
(...skipping 1967 matching lines...) Expand 10 before | Expand all | Expand 10 after
3041 EXPECT_TRUE(remover->is_removing()); 3041 EXPECT_TRUE(remover->is_removing());
3042 3042
3043 // Add one more deletion and wait for it. 3043 // Add one more deletion and wait for it.
3044 BlockUntilBrowsingDataRemoved( 3044 BlockUntilBrowsingDataRemoved(
3045 browsing_data::ALL_TIME, 3045 browsing_data::ALL_TIME,
3046 BrowsingDataRemover::REMOVE_COOKIES, 3046 BrowsingDataRemover::REMOVE_COOKIES,
3047 BrowsingDataHelper::UNPROTECTED_WEB); 3047 BrowsingDataHelper::UNPROTECTED_WEB);
3048 3048
3049 EXPECT_FALSE(remover->is_removing()); 3049 EXPECT_FALSE(remover->is_removing());
3050 } 3050 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_context_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698