OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |