| 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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 | 696 |
| 697 class BrowsingDataRemoverTest : public testing::Test, | 697 class BrowsingDataRemoverTest : public testing::Test, |
| 698 public content::NotificationObserver { | 698 public content::NotificationObserver { |
| 699 public: | 699 public: |
| 700 BrowsingDataRemoverTest() | 700 BrowsingDataRemoverTest() |
| 701 : profile_(new TestingProfile()) { | 701 : profile_(new TestingProfile()) { |
| 702 registrar_.Add(this, chrome::NOTIFICATION_BROWSING_DATA_REMOVED, | 702 registrar_.Add(this, chrome::NOTIFICATION_BROWSING_DATA_REMOVED, |
| 703 content::Source<Profile>(profile_.get())); | 703 content::Source<Profile>(profile_.get())); |
| 704 } | 704 } |
| 705 | 705 |
| 706 virtual ~BrowsingDataRemoverTest() { | 706 ~BrowsingDataRemoverTest() override {} |
| 707 } | |
| 708 | 707 |
| 709 virtual void TearDown() { | 708 void TearDown() override { |
| 710 #if defined(ENABLE_EXTENSIONS) | 709 #if defined(ENABLE_EXTENSIONS) |
| 711 mock_policy_ = NULL; | 710 mock_policy_ = NULL; |
| 712 #endif | 711 #endif |
| 713 | 712 |
| 714 // TestingProfile contains a DOMStorageContext. BrowserContext's destructor | 713 // TestingProfile contains a DOMStorageContext. BrowserContext's destructor |
| 715 // posts a message to the WEBKIT thread to delete some of its member | 714 // posts a message to the WEBKIT thread to delete some of its member |
| 716 // variables. We need to ensure that the profile is destroyed, and that | 715 // variables. We need to ensure that the profile is destroyed, and that |
| 717 // the message loop is cleared out, before destroying the threads and loop. | 716 // the message loop is cleared out, before destroying the threads and loop. |
| 718 // Otherwise we leak memory. | 717 // Otherwise we leak memory. |
| 719 profile_.reset(); | 718 profile_.reset(); |
| (...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1815 EXPECT_EQ(1u, tester.clear_count()); | 1814 EXPECT_EQ(1u, tester.clear_count()); |
| 1816 EXPECT_EQ(CLEAR_CONTEXTS, tester.last_clear_mode()); | 1815 EXPECT_EQ(CLEAR_CONTEXTS, tester.last_clear_mode()); |
| 1817 } | 1816 } |
| 1818 | 1817 |
| 1819 TEST_F(BrowsingDataRemoverTest, DomainReliability_NoMonitor) { | 1818 TEST_F(BrowsingDataRemoverTest, DomainReliability_NoMonitor) { |
| 1820 BlockUntilBrowsingDataRemoved( | 1819 BlockUntilBrowsingDataRemoved( |
| 1821 BrowsingDataRemover::EVERYTHING, | 1820 BrowsingDataRemover::EVERYTHING, |
| 1822 BrowsingDataRemover::REMOVE_HISTORY | | 1821 BrowsingDataRemover::REMOVE_HISTORY | |
| 1823 BrowsingDataRemover::REMOVE_COOKIES, false); | 1822 BrowsingDataRemover::REMOVE_COOKIES, false); |
| 1824 } | 1823 } |
| OLD | NEW |