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

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

Issue 352623002: Port History::QueryMostVisitedURLs to use CancelableTaskTracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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
« no previous file with comments | « chrome/browser/history/history_service.cc ('k') | chrome/browser/history/top_sites_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_unittest.cc
diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc
index 2f70bc91b8887bf1b8a0559daf02cdfc7d15e5e8..5b775780ec0b8afc4ba73886d20faa9d20f436d7 100644
--- a/chrome/browser/history/history_unittest.cc
+++ b/chrome/browser/history/history_unittest.cc
@@ -993,9 +993,8 @@ class HistoryTest : public testing::Test {
base::MessageLoop::current()->Quit();
}
- void OnMostVisitedURLsAvailable(CancelableRequestProvider::Handle handle,
- MostVisitedURLList url_list) {
- most_visited_urls_.swap(url_list);
+ void OnMostVisitedURLsAvailable(const MostVisitedURLList* url_list) {
+ most_visited_urls_ = *url_list;
base::MessageLoop::current()->Quit();
}
@@ -1478,10 +1477,11 @@ TEST_F(HistoryTest, MostVisitedURLs) {
history::RedirectList(), content::PAGE_TRANSITION_TYPED,
history::SOURCE_BROWSED, false);
history_service_->QueryMostVisitedURLs(
- 20, 90, &consumer_,
- base::Bind(
- &HistoryTest::OnMostVisitedURLsAvailable,
- base::Unretained(this)));
+ 20,
+ 90,
+ base::Bind(&HistoryTest::OnMostVisitedURLsAvailable,
+ base::Unretained(this)),
+ &tracker_);
base::MessageLoop::current()->Run();
EXPECT_EQ(2U, most_visited_urls_.size());
@@ -1494,10 +1494,11 @@ TEST_F(HistoryTest, MostVisitedURLs) {
history::RedirectList(), content::PAGE_TRANSITION_TYPED,
history::SOURCE_BROWSED, false);
history_service_->QueryMostVisitedURLs(
- 20, 90, &consumer_,
- base::Bind(
- &HistoryTest::OnMostVisitedURLsAvailable,
- base::Unretained(this)));
+ 20,
+ 90,
+ base::Bind(&HistoryTest::OnMostVisitedURLsAvailable,
+ base::Unretained(this)),
+ &tracker_);
base::MessageLoop::current()->Run();
EXPECT_EQ(3U, most_visited_urls_.size());
@@ -1511,10 +1512,11 @@ TEST_F(HistoryTest, MostVisitedURLs) {
history::RedirectList(), content::PAGE_TRANSITION_TYPED,
history::SOURCE_BROWSED, false);
history_service_->QueryMostVisitedURLs(
- 20, 90, &consumer_,
- base::Bind(
- &HistoryTest::OnMostVisitedURLsAvailable,
- base::Unretained(this)));
+ 20,
+ 90,
+ base::Bind(&HistoryTest::OnMostVisitedURLsAvailable,
+ base::Unretained(this)),
+ &tracker_);
base::MessageLoop::current()->Run();
EXPECT_EQ(3U, most_visited_urls_.size());
@@ -1528,10 +1530,11 @@ TEST_F(HistoryTest, MostVisitedURLs) {
history::RedirectList(), content::PAGE_TRANSITION_TYPED,
history::SOURCE_BROWSED, false);
history_service_->QueryMostVisitedURLs(
- 20, 90, &consumer_,
- base::Bind(
- &HistoryTest::OnMostVisitedURLsAvailable,
- base::Unretained(this)));
+ 20,
+ 90,
+ base::Bind(&HistoryTest::OnMostVisitedURLsAvailable,
+ base::Unretained(this)),
+ &tracker_);
base::MessageLoop::current()->Run();
EXPECT_EQ(3U, most_visited_urls_.size());
@@ -1550,10 +1553,11 @@ TEST_F(HistoryTest, MostVisitedURLs) {
redirects, content::PAGE_TRANSITION_TYPED,
history::SOURCE_BROWSED, false);
history_service_->QueryMostVisitedURLs(
- 20, 90, &consumer_,
- base::Bind(
- &HistoryTest::OnMostVisitedURLsAvailable,
- base::Unretained(this)));
+ 20,
+ 90,
+ base::Bind(&HistoryTest::OnMostVisitedURLsAvailable,
+ base::Unretained(this)),
+ &tracker_);
base::MessageLoop::current()->Run();
EXPECT_EQ(4U, most_visited_urls_.size());
« no previous file with comments | « chrome/browser/history/history_service.cc ('k') | chrome/browser/history/top_sites_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698