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

Side by Side Diff: chrome/browser/history/android/sqlite_cursor_unittest.cc

Issue 11759019: Update other unittests to use newly added TestingBrowserProcess::GetGlobal(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simpler codez Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/history/android/sqlite_cursor.h" 5 #include "chrome/browser/history/android/sqlite_cursor.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 23 matching lines...) Expand all
34 using history::HistoryAndBookmarkRow; 34 using history::HistoryAndBookmarkRow;
35 using history::SearchRow; 35 using history::SearchRow;
36 36
37 // The test cases in this file don't test the JNI interface which will be 37 // The test cases in this file don't test the JNI interface which will be
38 // covered in Java tests. 38 // covered in Java tests.
39 class SQLiteCursorTest : public testing::Test, 39 class SQLiteCursorTest : public testing::Test,
40 public SQLiteCursor::TestObserver { 40 public SQLiteCursor::TestObserver {
41 public: 41 public:
42 SQLiteCursorTest() 42 SQLiteCursorTest()
43 : profile_manager_( 43 : profile_manager_(
44 static_cast<TestingBrowserProcess*>(g_browser_process)), 44 TestingBrowserProcess::GetGlobal()),
45 ui_thread_(BrowserThread::UI, &message_loop_), 45 ui_thread_(BrowserThread::UI, &message_loop_),
46 file_thread_(BrowserThread::FILE, &message_loop_) { 46 file_thread_(BrowserThread::FILE, &message_loop_) {
47 } 47 }
48 virtual ~SQLiteCursorTest() { 48 virtual ~SQLiteCursorTest() {
49 } 49 }
50 50
51 protected: 51 protected:
52 virtual void SetUp() OVERRIDE { 52 virtual void SetUp() OVERRIDE {
53 // Setup the testing profile, so the bookmark_model_sql_handler could 53 // Setup the testing profile, so the bookmark_model_sql_handler could
54 // get the bookmark model from it. 54 // get the bookmark model from it.
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 std::vector<uint8> out; 213 std::vector<uint8> out;
214 base::android::JavaByteArrayToByteVector(env, data.obj(), &out); 214 base::android::JavaByteArrayToByteVector(env, data.obj(), &out);
215 EXPECT_EQ(data_bytes->data().size(), out.size()); 215 EXPECT_EQ(data_bytes->data().size(), out.size());
216 EXPECT_EQ(data_bytes->data()[0], out[0]); 216 EXPECT_EQ(data_bytes->data()[0], out[0]);
217 } 217 }
218 218
219 // Cursor's destructor post the task in UI thread, run Message loop to release 219 // Cursor's destructor post the task in UI thread, run Message loop to release
220 // the statement etc. 220 // the statement etc.
221 content::RunAllPendingInMessageLoop(); 221 content::RunAllPendingInMessageLoop();
222 } 222 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698