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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 }; | 376 }; |
377 | 377 |
378 class RemoveHistoryTester { | 378 class RemoveHistoryTester { |
379 public: | 379 public: |
380 RemoveHistoryTester() : query_url_success_(false), history_service_(NULL) {} | 380 RemoveHistoryTester() : query_url_success_(false), history_service_(NULL) {} |
381 | 381 |
382 bool Init(TestingProfile* profile) WARN_UNUSED_RESULT { | 382 bool Init(TestingProfile* profile) WARN_UNUSED_RESULT { |
383 if (!profile->CreateHistoryService(true, false)) | 383 if (!profile->CreateHistoryService(true, false)) |
384 return false; | 384 return false; |
385 history_service_ = HistoryServiceFactory::GetForProfile( | 385 history_service_ = HistoryServiceFactory::GetForProfile( |
386 profile, Profile::EXPLICIT_ACCESS); | 386 profile, ServiceAccessType::EXPLICIT_ACCESS); |
387 return true; | 387 return true; |
388 } | 388 } |
389 | 389 |
390 // Returns true, if the given URL exists in the history service. | 390 // Returns true, if the given URL exists in the history service. |
391 bool HistoryContainsURL(const GURL& url) { | 391 bool HistoryContainsURL(const GURL& url) { |
392 scoped_refptr<content::MessageLoopRunner> message_loop_runner = | 392 scoped_refptr<content::MessageLoopRunner> message_loop_runner = |
393 new content::MessageLoopRunner; | 393 new content::MessageLoopRunner; |
394 quit_closure_ = message_loop_runner->QuitClosure(); | 394 quit_closure_ = message_loop_runner->QuitClosure(); |
395 history_service_->QueryURL( | 395 history_service_->QueryURL( |
396 url, | 396 url, |
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1823 EXPECT_EQ(1u, tester.clear_count()); | 1823 EXPECT_EQ(1u, tester.clear_count()); |
1824 EXPECT_EQ(CLEAR_CONTEXTS, tester.last_clear_mode()); | 1824 EXPECT_EQ(CLEAR_CONTEXTS, tester.last_clear_mode()); |
1825 } | 1825 } |
1826 | 1826 |
1827 TEST_F(BrowsingDataRemoverTest, DomainReliability_NoMonitor) { | 1827 TEST_F(BrowsingDataRemoverTest, DomainReliability_NoMonitor) { |
1828 BlockUntilBrowsingDataRemoved( | 1828 BlockUntilBrowsingDataRemoved( |
1829 BrowsingDataRemover::EVERYTHING, | 1829 BrowsingDataRemover::EVERYTHING, |
1830 BrowsingDataRemover::REMOVE_HISTORY | | 1830 BrowsingDataRemover::REMOVE_HISTORY | |
1831 BrowsingDataRemover::REMOVE_COOKIES, false); | 1831 BrowsingDataRemover::REMOVE_COOKIES, false); |
1832 } | 1832 } |
OLD | NEW |