OLD | NEW |
---|---|
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 <set> | 10 #include <set> |
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1013 void BlockUntilOriginDataRemoved(BrowsingDataRemover::TimePeriod period, | 1013 void BlockUntilOriginDataRemoved(BrowsingDataRemover::TimePeriod period, |
1014 int remove_mask, | 1014 int remove_mask, |
1015 const GURL& remove_origin) { | 1015 const GURL& remove_origin) { |
1016 BrowsingDataRemover* remover = | 1016 BrowsingDataRemover* remover = |
1017 BrowsingDataRemoverFactory::GetForBrowserContext(profile_.get()); | 1017 BrowsingDataRemoverFactory::GetForBrowserContext(profile_.get()); |
1018 TestStoragePartition storage_partition; | 1018 TestStoragePartition storage_partition; |
1019 remover->OverrideStoragePartitionForTesting(&storage_partition); | 1019 remover->OverrideStoragePartitionForTesting(&storage_partition); |
1020 | 1020 |
1021 called_with_details_.reset(new BrowsingDataRemover::NotificationDetails()); | 1021 called_with_details_.reset(new BrowsingDataRemover::NotificationDetails()); |
1022 | 1022 |
1023 OriginFilterBuilder builder(OriginFilterBuilder::BLACKLIST); | |
msramek
2016/02/29 17:46:07
The semantic of |remove_origin| is WHITELIST.
dmurph
2016/03/01 00:10:00
Done.
| |
1024 builder.AddOrigin(url::Origin(remove_origin)); | |
1023 BrowsingDataRemoverCompletionObserver completion_observer(remover); | 1025 BrowsingDataRemoverCompletionObserver completion_observer(remover); |
1024 remover->RemoveImpl(BrowsingDataRemover::Period(period), remove_mask, | 1026 remover->RemoveImpl(BrowsingDataRemover::Period(period), remove_mask, |
1025 remove_origin, BrowsingDataHelper::UNPROTECTED_WEB); | 1027 builder, BrowsingDataHelper::UNPROTECTED_WEB); |
1026 completion_observer.BlockUntilCompletion(); | 1028 completion_observer.BlockUntilCompletion(); |
1027 | 1029 |
1028 // Save so we can verify later. | 1030 // Save so we can verify later. |
1029 storage_partition_removal_data_ = | 1031 storage_partition_removal_data_ = |
1030 storage_partition.GetStoragePartitionRemovalData(); | 1032 storage_partition.GetStoragePartitionRemovalData(); |
1031 } | 1033 } |
1032 | 1034 |
1033 TestingProfile* GetProfile() { | 1035 TestingProfile* GetProfile() { |
1034 return profile_.get(); | 1036 return profile_.get(); |
1035 } | 1037 } |
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2270 TEST_F(BrowsingDataRemoverTest, RemovePasswordsByOrigin) { | 2272 TEST_F(BrowsingDataRemoverTest, RemovePasswordsByOrigin) { |
2271 RemovePasswordsTester tester(GetProfile()); | 2273 RemovePasswordsTester tester(GetProfile()); |
2272 const url::Origin expectedOrigin(kOrigin1); | 2274 const url::Origin expectedOrigin(kOrigin1); |
2273 | 2275 |
2274 EXPECT_CALL(*tester.store(), | 2276 EXPECT_CALL(*tester.store(), |
2275 RemoveLoginsByOriginAndTimeImpl(SameOrigin(expectedOrigin), _, _)) | 2277 RemoveLoginsByOriginAndTimeImpl(SameOrigin(expectedOrigin), _, _)) |
2276 .WillOnce(Return(password_manager::PasswordStoreChangeList())); | 2278 .WillOnce(Return(password_manager::PasswordStoreChangeList())); |
2277 BlockUntilOriginDataRemoved(BrowsingDataRemover::EVERYTHING, | 2279 BlockUntilOriginDataRemoved(BrowsingDataRemover::EVERYTHING, |
2278 BrowsingDataRemover::REMOVE_PASSWORDS, kOrigin1); | 2280 BrowsingDataRemover::REMOVE_PASSWORDS, kOrigin1); |
2279 } | 2281 } |
OLD | NEW |