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

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

Issue 2386193004: Make all PermissionDecisionAutoBlocker methods static. (Closed)
Patch Set: 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
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 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 1029
1030 private: 1030 private:
1031 password_manager::MockPasswordStore* store_; 1031 password_manager::MockPasswordStore* store_;
1032 1032
1033 DISALLOW_COPY_AND_ASSIGN(RemovePasswordsTester); 1033 DISALLOW_COPY_AND_ASSIGN(RemovePasswordsTester);
1034 }; 1034 };
1035 1035
1036 class RemovePermissionPromptCountsTest { 1036 class RemovePermissionPromptCountsTest {
1037 public: 1037 public:
1038 explicit RemovePermissionPromptCountsTest(TestingProfile* profile) 1038 explicit RemovePermissionPromptCountsTest(TestingProfile* profile)
1039 : blocker_(new PermissionDecisionAutoBlocker(profile)), 1039 : profile_(profile) {}
1040 profile_(profile) {}
1041 1040
1042 int GetDismissCount(const GURL& url, content::PermissionType permission) { 1041 int GetDismissCount(const GURL& url, content::PermissionType permission) {
1043 return PermissionDecisionAutoBlocker::GetDismissCount( 1042 return PermissionDecisionAutoBlocker::GetDismissCount(
1044 url, permission, profile_); 1043 url, permission, profile_);
1045 } 1044 }
1046 1045
1047 int GetIgnoreCount(const GURL& url, content::PermissionType permission) { 1046 int GetIgnoreCount(const GURL& url, content::PermissionType permission) {
1048 return PermissionDecisionAutoBlocker::GetIgnoreCount( 1047 return PermissionDecisionAutoBlocker::GetIgnoreCount(
1049 url, permission, profile_); 1048 url, permission, profile_);
1050 } 1049 }
1051 1050
1052 int RecordIgnore(const GURL& url, content::PermissionType permission) { 1051 int RecordIgnore(const GURL& url, content::PermissionType permission) {
1053 return blocker_->RecordIgnore(url, permission); 1052 return PermissionDecisionAutoBlocker::RecordIgnore(url, permission,
1053 profile_);
1054 } 1054 }
1055 1055
1056 bool ShouldChangeDismissalToBlock(const GURL& url, 1056 bool ShouldChangeDismissalToBlock(const GURL& url,
1057 content::PermissionType permission) { 1057 content::PermissionType permission) {
1058 return blocker_->ShouldChangeDismissalToBlock(url, permission); 1058 return PermissionDecisionAutoBlocker::ShouldChangeDismissalToBlock(
1059 url, permission, profile_);
1059 } 1060 }
1060 1061
1061 private: 1062 private:
1062 std::unique_ptr<PermissionDecisionAutoBlocker> blocker_;
1063 TestingProfile* profile_; 1063 TestingProfile* profile_;
1064 1064
1065 DISALLOW_COPY_AND_ASSIGN(RemovePermissionPromptCountsTest); 1065 DISALLOW_COPY_AND_ASSIGN(RemovePermissionPromptCountsTest);
1066 }; 1066 };
1067 1067
1068 #if defined(ENABLE_PLUGINS) 1068 #if defined(ENABLE_PLUGINS)
1069 // A small modification to MockBrowsingDataFlashLSOHelper so that it responds 1069 // A small modification to MockBrowsingDataFlashLSOHelper so that it responds
1070 // immediately and does not wait for the Notify() call. Otherwise it would 1070 // immediately and does not wait for the Notify() call. Otherwise it would
1071 // deadlock BrowsingDataRemover::RemoveImpl. 1071 // deadlock BrowsingDataRemover::RemoveImpl.
1072 class TestBrowsingDataFlashLSOHelper : public MockBrowsingDataFlashLSOHelper { 1072 class TestBrowsingDataFlashLSOHelper : public MockBrowsingDataFlashLSOHelper {
(...skipping 1925 matching lines...) Expand 10 before | Expand all | Expand 10 after
2998 EXPECT_TRUE(remover->is_removing()); 2998 EXPECT_TRUE(remover->is_removing());
2999 2999
3000 // Add one more deletion and wait for it. 3000 // Add one more deletion and wait for it.
3001 BlockUntilBrowsingDataRemoved( 3001 BlockUntilBrowsingDataRemoved(
3002 browsing_data::ALL_TIME, 3002 browsing_data::ALL_TIME,
3003 BrowsingDataRemover::REMOVE_COOKIES, 3003 BrowsingDataRemover::REMOVE_COOKIES,
3004 BrowsingDataHelper::UNPROTECTED_WEB); 3004 BrowsingDataHelper::UNPROTECTED_WEB);
3005 3005
3006 EXPECT_FALSE(remover->is_removing()); 3006 EXPECT_FALSE(remover->is_removing());
3007 } 3007 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698