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

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

Issue 369673009: Change AndroidHistoryProviderService to use CancelableTaskTracker (2/6) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cancelable_task_tracker.2
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/sqlite_cursor_unittest.cc
diff --git a/chrome/browser/history/android/sqlite_cursor_unittest.cc b/chrome/browser/history/android/sqlite_cursor_unittest.cc
index 0896e66086c40783f33118ea81dd93030b7f2cd1..2fe66a9b9e1d7aee7ce77fb8026235ed4bbe840e 100644
--- a/chrome/browser/history/android/sqlite_cursor_unittest.cc
+++ b/chrome/browser/history/android/sqlite_cursor_unittest.cc
@@ -10,6 +10,7 @@
#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/task/cancelable_task_tracker.h"
#include "base/time/time.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/favicon/chrome_favicon_client.h"
@@ -103,6 +104,7 @@ class SQLiteCursorTest : public testing::Test,
content::TestBrowserThread ui_thread_;
content::TestBrowserThread file_thread_;
scoped_ptr<AndroidHistoryProviderService> service_;
+ base::CancelableTaskTracker cancelable_tracker_;
CancelableRequestConsumer cancelable_consumer_;
TestingProfile* testing_profile_;
HistoryService* hs_;
@@ -134,10 +136,8 @@ class CallbackHelper : public base::RefCountedThreadSafe<CallbackHelper> {
base::MessageLoop::current()->Quit();
}
- void OnQueryResult(AndroidHistoryProviderService::Handle handle,
- bool success,
- AndroidStatement* statement) {
- success_ = success;
+ void OnQueryResult(AndroidStatement* statement) {
+ success_ = statement != NULL;
statement_ = statement;
base::MessageLoop::current()->Quit();
}
@@ -183,9 +183,13 @@ TEST_F(SQLiteCursorTest, Run) {
projections.push_back(HistoryAndBookmarkRow::FAVICON);
// Query the inserted row.
- service_->QueryHistoryAndBookmarks(projections, std::string(),
- std::vector<base::string16>(), std::string(), &cancelable_consumer_,
- Bind(&CallbackHelper::OnQueryResult, callback.get()));
+ service_->QueryHistoryAndBookmarks(
+ projections,
+ std::string(),
+ std::vector<base::string16>(),
+ std::string(),
+ Bind(&CallbackHelper::OnQueryResult, callback.get()),
+ &cancelable_tracker_);
base::MessageLoop::current()->Run();
ASSERT_TRUE(callback->success());
« no previous file with comments | « chrome/browser/history/android/android_history_provider_service_unittest.cc ('k') | chrome/browser/history/history_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698