Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Side by Side Diff: chrome/browser/browsing_data/browsing_data_remover_impl_unittest.cc

Issue 2815913005: Switch to using scoped_ptr with UserData (Closed)
Patch Set: fixes Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_));
Nico 2017/04/14 15:46:58 That looks really surprising, having a member owne
Avi (use Gerrit) 2017/04/14 18:17:50 Done.
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:
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698