diff options
Diffstat (limited to 'chrome/browser/history/history_unittest.cc')
| -rw-r--r-- | chrome/browser/history/history_unittest.cc | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc index ac38745..2cd7a2d 100644 --- a/chrome/browser/history/history_unittest.cc +++ b/chrome/browser/history/history_unittest.cc @@ -231,8 +231,7 @@ class HistoryTest : public testing::Test { // returning true on success. False means the URL was not found. bool QueryRedirectsFrom(HistoryService* history, const GURL& url) { history->QueryRedirectsFrom(url, &consumer_, - base::Bind(&HistoryTest::OnRedirectQueryComplete, - base::Unretained(this))); + NewCallback(this, &HistoryTest::OnRedirectQueryComplete)); MessageLoop::current()->Run(); // Will be exited in *QueryComplete. return redirect_query_success_; } @@ -629,8 +628,8 @@ TEST_F(HistoryTest, Segments) { // Make sure a segment was created. history->QuerySegmentUsageSince( &consumer_, Time::Now() - TimeDelta::FromDays(1), 10, - base::Bind(&HistoryTest::OnSegmentUsageAvailable, - base::Unretained(this))); + NewCallback(static_cast<HistoryTest*>(this), + &HistoryTest::OnSegmentUsageAvailable)); // Wait for processing. MessageLoop::current()->Run(); @@ -648,8 +647,8 @@ TEST_F(HistoryTest, Segments) { // Query again history->QuerySegmentUsageSince( &consumer_, Time::Now() - TimeDelta::FromDays(1), 10, - base::Bind(&HistoryTest::OnSegmentUsageAvailable, - base::Unretained(this))); + NewCallback(static_cast<HistoryTest*>(this), + &HistoryTest::OnSegmentUsageAvailable)); // Wait for processing. MessageLoop::current()->Run(); @@ -666,8 +665,8 @@ TEST_F(HistoryTest, Segments) { // Query again history->QuerySegmentUsageSince( &consumer_, Time::Now() - TimeDelta::FromDays(1), 10, - base::Bind(&HistoryTest::OnSegmentUsageAvailable, - base::Unretained(this))); + NewCallback(static_cast<HistoryTest*>(this), + &HistoryTest::OnSegmentUsageAvailable)); // Wait for processing. MessageLoop::current()->Run(); @@ -701,9 +700,8 @@ TEST_F(HistoryTest, MostVisitedURLs) { PageTransition::TYPED, history::RedirectList(), history::SOURCE_BROWSED, false); history->QueryMostVisitedURLs(20, 90, &consumer_, - base::Bind( - &HistoryTest::OnMostVisitedURLsAvailable, - base::Unretained(this))); + NewCallback(static_cast<HistoryTest*>(this), + &HistoryTest::OnMostVisitedURLsAvailable)); MessageLoop::current()->Run(); EXPECT_EQ(2U, most_visited_urls_.size()); @@ -715,9 +713,8 @@ TEST_F(HistoryTest, MostVisitedURLs) { PageTransition::TYPED, history::RedirectList(), history::SOURCE_BROWSED, false); history->QueryMostVisitedURLs(20, 90, &consumer_, - base::Bind( - &HistoryTest::OnMostVisitedURLsAvailable, - base::Unretained(this))); + NewCallback(static_cast<HistoryTest*>(this), + &HistoryTest::OnMostVisitedURLsAvailable)); MessageLoop::current()->Run(); EXPECT_EQ(3U, most_visited_urls_.size()); @@ -730,9 +727,8 @@ TEST_F(HistoryTest, MostVisitedURLs) { PageTransition::TYPED, history::RedirectList(), history::SOURCE_BROWSED, false); history->QueryMostVisitedURLs(20, 90, &consumer_, - base::Bind( - &HistoryTest::OnMostVisitedURLsAvailable, - base::Unretained(this))); + NewCallback(static_cast<HistoryTest*>(this), + &HistoryTest::OnMostVisitedURLsAvailable)); MessageLoop::current()->Run(); EXPECT_EQ(3U, most_visited_urls_.size()); @@ -745,9 +741,8 @@ TEST_F(HistoryTest, MostVisitedURLs) { PageTransition::TYPED, history::RedirectList(), history::SOURCE_BROWSED, false); history->QueryMostVisitedURLs(20, 90, &consumer_, - base::Bind( - &HistoryTest::OnMostVisitedURLsAvailable, - base::Unretained(this))); + NewCallback(static_cast<HistoryTest*>(this), + &HistoryTest::OnMostVisitedURLsAvailable)); MessageLoop::current()->Run(); EXPECT_EQ(3U, most_visited_urls_.size()); @@ -765,9 +760,8 @@ TEST_F(HistoryTest, MostVisitedURLs) { PageTransition::TYPED, redirects, history::SOURCE_BROWSED, false); history->QueryMostVisitedURLs(20, 90, &consumer_, - base::Bind( - &HistoryTest::OnMostVisitedURLsAvailable, - base::Unretained(this))); + NewCallback(static_cast<HistoryTest*>(this), + &HistoryTest::OnMostVisitedURLsAvailable)); MessageLoop::current()->Run(); EXPECT_EQ(4U, most_visited_urls_.size()); |
