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 <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 257 matching lines...) Loading... |
268 quit_closure_.Run(); | 268 quit_closure_.Run(); |
269 } | 269 } |
270 | 270 |
271 bool get_cookie_success_; | 271 bool get_cookie_success_; |
272 base::Closure quit_closure_; | 272 base::Closure quit_closure_; |
273 net::CookieStore* cookie_store_; | 273 net::CookieStore* cookie_store_; |
274 | 274 |
275 DISALLOW_COPY_AND_ASSIGN(RemoveCookieTester); | 275 DISALLOW_COPY_AND_ASSIGN(RemoveCookieTester); |
276 }; | 276 }; |
277 | 277 |
278 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | 278 #if defined(SAFE_BROWSING_SERVICE) |
279 class RemoveSafeBrowsingCookieTester : public RemoveCookieTester { | 279 class RemoveSafeBrowsingCookieTester : public RemoveCookieTester { |
280 public: | 280 public: |
281 RemoveSafeBrowsingCookieTester() | 281 RemoveSafeBrowsingCookieTester() |
282 : browser_process_(TestingBrowserProcess::GetGlobal()) { | 282 : browser_process_(TestingBrowserProcess::GetGlobal()) { |
283 scoped_refptr<SafeBrowsingService> sb_service = | 283 scoped_refptr<SafeBrowsingService> sb_service = |
284 SafeBrowsingService::CreateSafeBrowsingService(); | 284 SafeBrowsingService::CreateSafeBrowsingService(); |
285 browser_process_->SetSafeBrowsingService(sb_service.get()); | 285 browser_process_->SetSafeBrowsingService(sb_service.get()); |
286 sb_service->Initialize(); | 286 sb_service->Initialize(); |
287 base::MessageLoop::current()->RunUntilIdle(); | 287 base::MessageLoop::current()->RunUntilIdle(); |
288 | 288 |
(...skipping 609 matching lines...) Loading... |
898 EXPECT_EQ(removal_data.remove_mask, | 898 EXPECT_EQ(removal_data.remove_mask, |
899 StoragePartition::REMOVE_DATA_MASK_COOKIES); | 899 StoragePartition::REMOVE_DATA_MASK_COOKIES); |
900 // Removing with time period other than EVERYTHING should not clear | 900 // Removing with time period other than EVERYTHING should not clear |
901 // persistent storage data. | 901 // persistent storage data. |
902 EXPECT_EQ(removal_data.quota_storage_remove_mask, | 902 EXPECT_EQ(removal_data.quota_storage_remove_mask, |
903 ~StoragePartition::QUOTA_MANAGED_STORAGE_MASK_PERSISTENT); | 903 ~StoragePartition::QUOTA_MANAGED_STORAGE_MASK_PERSISTENT); |
904 EXPECT_TRUE(removal_data.remove_origin.is_empty()); | 904 EXPECT_TRUE(removal_data.remove_origin.is_empty()); |
905 EXPECT_EQ(removal_data.remove_begin, GetBeginTime()); | 905 EXPECT_EQ(removal_data.remove_begin, GetBeginTime()); |
906 } | 906 } |
907 | 907 |
908 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | 908 #if defined(SAFE_BROWSING_SERVICE) |
909 TEST_F(BrowsingDataRemoverTest, RemoveSafeBrowsingCookieForever) { | 909 TEST_F(BrowsingDataRemoverTest, RemoveSafeBrowsingCookieForever) { |
910 RemoveSafeBrowsingCookieTester tester; | 910 RemoveSafeBrowsingCookieTester tester; |
911 | 911 |
912 tester.AddCookie(); | 912 tester.AddCookie(); |
913 ASSERT_TRUE(tester.ContainsCookie()); | 913 ASSERT_TRUE(tester.ContainsCookie()); |
914 | 914 |
915 BlockUntilBrowsingDataRemoved(BrowsingDataRemover::EVERYTHING, | 915 BlockUntilBrowsingDataRemoved(BrowsingDataRemover::EVERYTHING, |
916 BrowsingDataRemover::REMOVE_COOKIES, false); | 916 BrowsingDataRemover::REMOVE_COOKIES, false); |
917 | 917 |
918 EXPECT_EQ(BrowsingDataRemover::REMOVE_COOKIES, GetRemovalMask()); | 918 EXPECT_EQ(BrowsingDataRemover::REMOVE_COOKIES, GetRemovalMask()); |
(...skipping 923 matching lines...) Loading... |
1842 // TODO(ttuttle): This isn't actually testing the no-monitor case, since | 1842 // TODO(ttuttle): This isn't actually testing the no-monitor case, since |
1843 // BrowsingDataRemoverTest now creates one unconditionally, since it's needed | 1843 // BrowsingDataRemoverTest now creates one unconditionally, since it's needed |
1844 // for some unrelated test cases. This should be fixed so it tests the no- | 1844 // for some unrelated test cases. This should be fixed so it tests the no- |
1845 // monitor case again. | 1845 // monitor case again. |
1846 TEST_F(BrowsingDataRemoverTest, DISABLED_DomainReliability_NoMonitor) { | 1846 TEST_F(BrowsingDataRemoverTest, DISABLED_DomainReliability_NoMonitor) { |
1847 BlockUntilBrowsingDataRemoved( | 1847 BlockUntilBrowsingDataRemoved( |
1848 BrowsingDataRemover::EVERYTHING, | 1848 BrowsingDataRemover::EVERYTHING, |
1849 BrowsingDataRemover::REMOVE_HISTORY | | 1849 BrowsingDataRemover::REMOVE_HISTORY | |
1850 BrowsingDataRemover::REMOVE_COOKIES, false); | 1850 BrowsingDataRemover::REMOVE_COOKIES, false); |
1851 } | 1851 } |
OLD | NEW |