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

Unified Diff: chrome/browser/history/top_sites_impl_unittest.cc

Issue 352913002: Port HistoryService::ScheduleDBTask to CancelableTaskTracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix lifetime of base::CancelableTaskTracker for HistoryModelWorker Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/history/top_sites_impl_unittest.cc
diff --git a/chrome/browser/history/top_sites_impl_unittest.cc b/chrome/browser/history/top_sites_impl_unittest.cc
index d3d8eb3c8fbfc7ee809d3090f68f8998da03de75..7d070561c85eb3b036484359e57b35866d739924 100644
--- a/chrome/browser/history/top_sites_impl_unittest.cc
+++ b/chrome/browser/history/top_sites_impl_unittest.cc
@@ -181,7 +181,8 @@ class TopSitesImplTest : public HistoryUnitTestBase {
// Blocks the caller until history processes a task. This is useful if you
// need to wait until you know history has processed a task.
void WaitForHistory() {
- history_service()->ScheduleDBTask(new WaitForHistoryTask(), &consumer_);
+ history_service()->ScheduleDBTask(new WaitForHistoryTask(),
+ &history_tracker_);
base::MessageLoop::current()->Run();
}
@@ -190,14 +191,13 @@ class TopSitesImplTest : public HistoryUnitTestBase {
void WaitForTopSites() {
top_sites()->backend_->DoEmptyRequest(
base::Bind(&TopSitesImplTest::QuitCallback, base::Unretained(this)),
- &cancelable_task_tracker_);
+ &top_sites_tracker_);
base::MessageLoop::current()->Run();
}
TopSitesImpl* top_sites() {
return static_cast<TopSitesImpl*>(profile_->GetTopSites());
}
- CancelableRequestConsumer* consumer() { return &consumer_; }
TestingProfile* profile() {return profile_.get();}
HistoryService* history_service() {
return HistoryServiceFactory::GetForProfile(profile_.get(),
@@ -332,10 +332,10 @@ class TopSitesImplTest : public HistoryUnitTestBase {
scoped_ptr<TestingProfile> profile_;
// To cancel HistoryService tasks.
- CancelableRequestConsumer consumer_;
+ base::CancelableTaskTracker history_tracker_;
// To cancel TopSitesBackend tasks.
- base::CancelableTaskTracker cancelable_task_tracker_;
+ base::CancelableTaskTracker top_sites_tracker_;
DISALLOW_COPY_AND_ASSIGN(TopSitesImplTest);
}; // Class TopSitesImplTest
« no previous file with comments | « chrome/browser/history/in_memory_url_index_unittest.cc ('k') | chrome/browser/history/url_index_private_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698