Chromium Code Reviews| 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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 508 std::vector<content::LocalStorageUsageInfo> infos_; | 508 std::vector<content::LocalStorageUsageInfo> infos_; |
| 509 base::Closure quit_closure_; | 509 base::Closure quit_closure_; |
| 510 | 510 |
| 511 DISALLOW_COPY_AND_ASSIGN(RemoveLocalStorageTester); | 511 DISALLOW_COPY_AND_ASSIGN(RemoveLocalStorageTester); |
| 512 }; | 512 }; |
| 513 | 513 |
| 514 class RemoveDownloadsTester { | 514 class RemoveDownloadsTester { |
| 515 public: | 515 public: |
| 516 explicit RemoveDownloadsTester(BrowserContext* browser_context) | 516 explicit RemoveDownloadsTester(BrowserContext* browser_context) |
| 517 : download_manager_(new content::MockDownloadManager()) { | 517 : download_manager_(new content::MockDownloadManager()) { |
| 518 content::BrowserContext::SetDownloadManagerForTesting(browser_context, | 518 content::BrowserContext::SetDownloadManagerForTesting( |
| 519 download_manager_); | 519 browser_context, base::WrapUnique(download_manager_)); |
| 520 EXPECT_EQ(download_manager_, | 520 EXPECT_EQ(download_manager_, |
| 521 content::BrowserContext::GetDownloadManager(browser_context)); | 521 content::BrowserContext::GetDownloadManager(browser_context)); |
| 522 EXPECT_CALL(*download_manager_, Shutdown()); | 522 EXPECT_CALL(*download_manager_, Shutdown()); |
| 523 } | 523 } |
| 524 | 524 |
| 525 ~RemoveDownloadsTester() {} | 525 ~RemoveDownloadsTester() {} |
| 526 | 526 |
| 527 content::MockDownloadManager* download_manager() { return download_manager_; } | 527 content::MockDownloadManager* download_manager() { return download_manager_; } |
| 528 | 528 |
| 529 private: | 529 private: |
| 530 content::MockDownloadManager* download_manager_; | 530 content::MockDownloadManager* download_manager_; // owned by browser context |
|
Nico
2017/04/14 18:53:20
nit: style guide says upper case, . at end (in the
Avi (use Gerrit)
2017/04/14 18:59:38
Done.
| |
| 531 | 531 |
| 532 DISALLOW_COPY_AND_ASSIGN(RemoveDownloadsTester); | 532 DISALLOW_COPY_AND_ASSIGN(RemoveDownloadsTester); |
| 533 }; | 533 }; |
| 534 | 534 |
| 535 // Test Class ---------------------------------------------------------------- | 535 // Test Class ---------------------------------------------------------------- |
| 536 | 536 |
| 537 class BrowsingDataRemoverImplTest : public testing::Test { | 537 class BrowsingDataRemoverImplTest : public testing::Test { |
| 538 public: | 538 public: |
| 539 BrowsingDataRemoverImplTest() | 539 BrowsingDataRemoverImplTest() |
| 540 : browser_context_(new TestingProfile()) { | 540 : browser_context_(new TestingProfile()) { |
| (...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1707 | 1707 |
| 1708 EXPECT_TRUE(remover->is_removing()); | 1708 EXPECT_TRUE(remover->is_removing()); |
| 1709 | 1709 |
| 1710 // Add one more deletion and wait for it. | 1710 // Add one more deletion and wait for it. |
| 1711 BlockUntilBrowsingDataRemoved( | 1711 BlockUntilBrowsingDataRemoved( |
| 1712 base::Time(), base::Time::Max(), BrowsingDataRemover::DATA_TYPE_COOKIES, | 1712 base::Time(), base::Time::Max(), BrowsingDataRemover::DATA_TYPE_COOKIES, |
| 1713 BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB); | 1713 BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB); |
| 1714 | 1714 |
| 1715 EXPECT_FALSE(remover->is_removing()); | 1715 EXPECT_FALSE(remover->is_removing()); |
| 1716 } | 1716 } |
| OLD | NEW |