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

Unified Diff: chrome/browser/history/android/android_history_provider_service_unittest.cc

Issue 368283003: Change AndroidHistoryProviderService to use CancelableTaskTracker (5/6) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cancelable_task_tracker.5
Patch Set: Fix unit tests Created 6 years, 5 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/android/android_history_provider_service_unittest.cc
diff --git a/chrome/browser/history/android/android_history_provider_service_unittest.cc b/chrome/browser/history/android/android_history_provider_service_unittest.cc
index 27f0eade32a096e8df3cb6831f31cd91b6bcc637..3af7a57c39d2951866101225617b0355b91a9c4c 100644
--- a/chrome/browser/history/android/android_history_provider_service_unittest.cc
+++ b/chrome/browser/history/android/android_history_provider_service_unittest.cc
@@ -116,10 +116,8 @@ class CallbackHelper : public base::RefCountedThreadSafe<CallbackHelper> {
base::MessageLoop::current()->Quit();
}
- void OnUpdated(AndroidHistoryProviderService::Handle handle,
- bool success,
- int count) {
- success_ = success;
+ void OnUpdated(int count) {
+ success_ = count != 0;
count_ = count;
base::MessageLoop::current()->Quit();
}
@@ -198,9 +196,12 @@ TEST_F(AndroidHistoryProviderServiceTest, TestHistoryAndBookmark) {
// Update the row.
HistoryAndBookmarkRow update_row;
update_row.set_visit_count(3);
- service_->UpdateHistoryAndBookmarks(update_row, std::string(),
- std::vector<base::string16>(), &cancelable_consumer_,
- Bind(&CallbackHelper::OnUpdated, callback.get()));
+ service_->UpdateHistoryAndBookmarks(
+ update_row,
+ std::string(),
+ std::vector<base::string16>(),
+ Bind(&CallbackHelper::OnUpdated, callback.get()),
+ &cancelable_tracker_);
base::MessageLoop::current()->Run();
EXPECT_TRUE(callback->success());
EXPECT_EQ(1, callback->count());
@@ -263,9 +264,11 @@ TEST_F(AndroidHistoryProviderServiceTest, TestSearchTerm) {
// Update the row.
SearchRow update_row;
update_row.set_search_time(Time::Now());
- service_->UpdateSearchTerms(update_row, std::string(),
- std::vector<base::string16>(), &cancelable_consumer_,
- Bind(&CallbackHelper::OnUpdated, callback.get()));
+ service_->UpdateSearchTerms(update_row,
+ std::string(),
+ std::vector<base::string16>(),
+ Bind(&CallbackHelper::OnUpdated, callback.get()),
+ &cancelable_tracker_);
base::MessageLoop::current()->Run();
EXPECT_TRUE(callback->success());
EXPECT_EQ(1, callback->count());
« no previous file with comments | « chrome/browser/history/android/android_history_provider_service.cc ('k') | chrome/browser/history/history_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698