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

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

Issue 2637043002: Move plugins to ChromeBrowsingDataRemoverDelegate. (Closed)
Patch Set: Rebase. Created 3 years, 11 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 (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 <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 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 private: 1104 private:
1105 ~TestBrowsingDataFlashLSOHelper() override {} 1105 ~TestBrowsingDataFlashLSOHelper() override {}
1106 1106
1107 DISALLOW_COPY_AND_ASSIGN(TestBrowsingDataFlashLSOHelper); 1107 DISALLOW_COPY_AND_ASSIGN(TestBrowsingDataFlashLSOHelper);
1108 }; 1108 };
1109 1109
1110 class RemovePluginDataTester { 1110 class RemovePluginDataTester {
1111 public: 1111 public:
1112 explicit RemovePluginDataTester(TestingProfile* profile) 1112 explicit RemovePluginDataTester(TestingProfile* profile)
1113 : helper_(new TestBrowsingDataFlashLSOHelper(profile)) { 1113 : helper_(new TestBrowsingDataFlashLSOHelper(profile)) {
1114 static_cast<BrowsingDataRemoverImpl*>( 1114 static_cast<ChromeBrowsingDataRemoverDelegate*>(
1115 BrowsingDataRemoverFactory::GetForBrowserContext(profile)) 1115 BrowsingDataRemoverFactory::GetForBrowserContext(profile)
1116 ->OverrideFlashLSOHelperForTesting(helper_); 1116 ->GetEmbedderDelegate())->OverrideFlashLSOHelperForTesting(helper_);
1117 } 1117 }
1118 1118
1119 void AddDomain(const std::string& domain) { 1119 void AddDomain(const std::string& domain) {
1120 helper_->AddFlashLSODomain(domain); 1120 helper_->AddFlashLSODomain(domain);
1121 } 1121 }
1122 1122
1123 const std::vector<std::string>& GetDomains() { 1123 const std::vector<std::string>& GetDomains() {
1124 // TestBrowsingDataFlashLSOHelper is synchronous, so we can immediately 1124 // TestBrowsingDataFlashLSOHelper is synchronous, so we can immediately
1125 // return the fetched domains. 1125 // return the fetched domains.
1126 helper_->StartFetching( 1126 helper_->StartFetching(
(...skipping 2002 matching lines...) Expand 10 before | Expand all | Expand 10 after
3129 completion_observer.BlockUntilCompletion(); 3129 completion_observer.BlockUntilCompletion();
3130 3130
3131 // There should be only 1 recently visited bookmarks. 3131 // There should be only 1 recently visited bookmarks.
3132 std::vector<const bookmarks::BookmarkNode*> remaining_nodes = 3132 std::vector<const bookmarks::BookmarkNode*> remaining_nodes =
3133 ntp_snippets::GetRecentlyVisitedBookmarks( 3133 ntp_snippets::GetRecentlyVisitedBookmarks(
3134 bookmark_model, 3, base::Time::UnixEpoch(), 3134 bookmark_model, 3, base::Time::UnixEpoch(),
3135 /*consider_visits_from_desktop=*/true); 3135 /*consider_visits_from_desktop=*/true);
3136 EXPECT_THAT(remaining_nodes, SizeIs(1)); 3136 EXPECT_THAT(remaining_nodes, SizeIs(1));
3137 EXPECT_THAT(remaining_nodes[0]->url().spec(), Eq("http://foo-2.org/")); 3137 EXPECT_THAT(remaining_nodes[0]->url().spec(), Eq("http://foo-2.org/"));
3138 } 3138 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698