Chromium Code Reviews| Index: chrome/browser/history/history_unittest.cc |
| diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc |
| index 411c712dae9d5ca72f9b1580996f2ff44058ad03..e123fa6f01fb34df331a0fe7afb6441110d78fdb 100644 |
| --- a/chrome/browser/history/history_unittest.cc |
| +++ b/chrome/browser/history/history_unittest.cc |
| @@ -39,6 +39,7 @@ |
| #include "base/strings/string_util.h" |
| #include "base/strings/stringprintf.h" |
| #include "base/strings/utf_string_conversions.h" |
| +#include "base/task/cancelable_task_tracker.h" |
| #include "base/threading/platform_thread.h" |
| #include "base/time/time.h" |
| #include "chrome/browser/history/download_row.h" |
| @@ -979,22 +980,24 @@ class HistoryTest : public testing::Test { |
| // information about the given URL and returns true. If the URL was not |
| // found, this will return false and those structures will not be changed. |
| bool QueryURL(HistoryService* history, const GURL& url) { |
| - history_service_->QueryURL(url, true, &consumer_, |
| - base::Bind(&HistoryTest::SaveURLAndQuit, |
| - base::Unretained(this))); |
| + history_service_->QueryURL( |
| + url, |
| + true, |
| + base::Bind(&HistoryTest::SaveURLAndQuit, base::Unretained(this)), |
| + &tracker_); |
| base::MessageLoop::current()->Run(); // Will be exited in SaveURLAndQuit. |
| return query_url_success_; |
| } |
| // Callback for HistoryService::QueryURL. |
| - void SaveURLAndQuit(HistoryService::Handle handle, |
| - bool success, |
| - const URLRow* url_row, |
| - VisitVector* visit_vector) { |
| + void SaveURLAndQuit(bool success, |
| + const URLRow& url_row, |
| + const VisitVector* visit_vector) { |
| query_url_success_ = success; |
| if (query_url_success_) { |
| - query_url_row_ = *url_row; |
| - query_url_visits_.swap(*visit_vector); |
| + DCHECK(visit_vector); |
| + query_url_row_ = url_row; |
| + query_url_visits_ = *visit_vector; |
| } else { |
| query_url_row_ = URLRow(); |
| query_url_visits_.clear(); |
| @@ -1054,6 +1057,7 @@ class HistoryTest : public testing::Test { |
| bool redirect_query_success_; |
| // For history requests. |
| + base::CancelableTaskTracker tracker_; |
| CancelableRequestConsumer consumer_; |
|
blundell
2014/06/11 11:08:40
This is still used by other code in this file I ta
sdefresne
2014/06/11 16:46:25
Yes.
|
| // For saving URL info after a call to QueryURL |