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

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

Issue 365133003: Change AndroidHistoryProviderService to use CancelableTaskTracker (4/6) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cancelable_task_tracker.4
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 8595ff21a0efcc76e89866f5061ad2c61dd000db..27f0eade32a096e8df3cb6831f31cd91b6bcc637 100644
--- a/chrome/browser/history/android/android_history_provider_service_unittest.cc
+++ b/chrome/browser/history/android/android_history_provider_service_unittest.cc
@@ -105,10 +105,8 @@ class CallbackHelper : public base::RefCountedThreadSafe<CallbackHelper> {
return count_;
}
- void OnInserted(AndroidHistoryProviderService::Handle handle,
- bool success,
- int64 id) {
- success_ = success;
+ void OnInserted(int64 id) {
+ success_ = id != 0;
base::MessageLoop::current()->Quit();
}
@@ -160,8 +158,10 @@ TEST_F(AndroidHistoryProviderServiceTest, TestHistoryAndBookmark) {
scoped_refptr<CallbackHelper> callback(new CallbackHelper());
// Insert a row and verify it succeeded.
- service_->InsertHistoryAndBookmark(row, &cancelable_consumer_,
- Bind(&CallbackHelper::OnInserted, callback.get()));
+ service_->InsertHistoryAndBookmark(
+ row,
+ Bind(&CallbackHelper::OnInserted, callback.get()),
+ &cancelable_tracker_);
base::MessageLoop::current()->Run();
EXPECT_TRUE(callback->success());
@@ -224,8 +224,9 @@ TEST_F(AndroidHistoryProviderServiceTest, TestSearchTerm) {
scoped_refptr<CallbackHelper> callback(new CallbackHelper());
// Insert a row and verify it succeeded.
- service_->InsertSearchTerm(search_row, &cancelable_consumer_,
- Bind(&CallbackHelper::OnInserted, callback.get()));
+ service_->InsertSearchTerm(search_row,
+ Bind(&CallbackHelper::OnInserted, callback.get()),
+ &cancelable_tracker_);
base::MessageLoop::current()->Run();
EXPECT_TRUE(callback->success());

Powered by Google App Engine
This is Rietveld 408576698