| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 std::vector<content::LocalStorageUsageInfo> infos_; | 507 std::vector<content::LocalStorageUsageInfo> infos_; |
| 508 base::Closure quit_closure_; | 508 base::Closure quit_closure_; |
| 509 | 509 |
| 510 DISALLOW_COPY_AND_ASSIGN(RemoveLocalStorageTester); | 510 DISALLOW_COPY_AND_ASSIGN(RemoveLocalStorageTester); |
| 511 }; | 511 }; |
| 512 | 512 |
| 513 class RemoveDownloadsTester { | 513 class RemoveDownloadsTester { |
| 514 public: | 514 public: |
| 515 explicit RemoveDownloadsTester(BrowserContext* browser_context) | 515 explicit RemoveDownloadsTester(BrowserContext* browser_context) |
| 516 : download_manager_(new content::MockDownloadManager()) { | 516 : download_manager_(new content::MockDownloadManager()) { |
| 517 content::BrowserContext::SetDownloadManagerForTesting(browser_context, | 517 content::BrowserContext::SetDownloadManagerForTesting( |
| 518 download_manager_); | 518 browser_context, base::WrapUnique(download_manager_)); |
| 519 EXPECT_EQ(download_manager_, | 519 EXPECT_EQ(download_manager_, |
| 520 content::BrowserContext::GetDownloadManager(browser_context)); | 520 content::BrowserContext::GetDownloadManager(browser_context)); |
| 521 EXPECT_CALL(*download_manager_, Shutdown()); | 521 EXPECT_CALL(*download_manager_, Shutdown()); |
| 522 } | 522 } |
| 523 | 523 |
| 524 ~RemoveDownloadsTester() {} | 524 ~RemoveDownloadsTester() {} |
| 525 | 525 |
| 526 content::MockDownloadManager* download_manager() { return download_manager_; } | 526 content::MockDownloadManager* download_manager() { return download_manager_; } |
| 527 | 527 |
| 528 private: | 528 private: |
| 529 content::MockDownloadManager* download_manager_; | 529 content::MockDownloadManager* download_manager_; // Owned by browser context. |
| 530 | 530 |
| 531 DISALLOW_COPY_AND_ASSIGN(RemoveDownloadsTester); | 531 DISALLOW_COPY_AND_ASSIGN(RemoveDownloadsTester); |
| 532 }; | 532 }; |
| 533 | 533 |
| 534 // Test Class ---------------------------------------------------------------- | 534 // Test Class ---------------------------------------------------------------- |
| 535 | 535 |
| 536 class BrowsingDataRemoverImplTest : public testing::Test { | 536 class BrowsingDataRemoverImplTest : public testing::Test { |
| 537 public: | 537 public: |
| 538 BrowsingDataRemoverImplTest() | 538 BrowsingDataRemoverImplTest() |
| 539 : browser_context_(new TestingProfile()) { | 539 : browser_context_(new TestingProfile()) { |
| (...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1706 | 1706 |
| 1707 EXPECT_TRUE(remover->is_removing()); | 1707 EXPECT_TRUE(remover->is_removing()); |
| 1708 | 1708 |
| 1709 // Add one more deletion and wait for it. | 1709 // Add one more deletion and wait for it. |
| 1710 BlockUntilBrowsingDataRemoved( | 1710 BlockUntilBrowsingDataRemoved( |
| 1711 base::Time(), base::Time::Max(), BrowsingDataRemover::DATA_TYPE_COOKIES, | 1711 base::Time(), base::Time::Max(), BrowsingDataRemover::DATA_TYPE_COOKIES, |
| 1712 BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB); | 1712 BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB); |
| 1713 | 1713 |
| 1714 EXPECT_FALSE(remover->is_removing()); | 1714 EXPECT_FALSE(remover->is_removing()); |
| 1715 } | 1715 } |
| OLD | NEW |