| 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 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 run_loop_->Run(); | 95 run_loop_->Run(); |
| 96 run_loop_ = nullptr; | 96 run_loop_ = nullptr; |
| 97 } | 97 } |
| 98 | 98 |
| 99 void OnGetFaviconResult() override { | 99 void OnGetFaviconResult() override { |
| 100 ASSERT_TRUE(run_loop_); | 100 ASSERT_TRUE(run_loop_); |
| 101 run_loop_->QuitWhenIdle(); | 101 run_loop_->QuitWhenIdle(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 protected: | 104 protected: |
| 105 content::TestBrowserThreadBundle test_browser_thread_bundle_; |
| 105 TestingProfileManager profile_manager_; | 106 TestingProfileManager profile_manager_; |
| 106 content::TestBrowserThreadBundle test_browser_thread_bundle_; | |
| 107 std::unique_ptr<AndroidHistoryProviderService> service_; | 107 std::unique_ptr<AndroidHistoryProviderService> service_; |
| 108 base::CancelableTaskTracker cancelable_tracker_; | 108 base::CancelableTaskTracker cancelable_tracker_; |
| 109 TestingProfile* testing_profile_; | 109 TestingProfile* testing_profile_; |
| 110 history::HistoryService* hs_; | 110 history::HistoryService* hs_; |
| 111 std::unique_ptr<base::RunLoop> run_loop_; | 111 std::unique_ptr<base::RunLoop> run_loop_; |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 DISALLOW_COPY_AND_ASSIGN(SQLiteCursorTest); | 114 DISALLOW_COPY_AND_ASSIGN(SQLiteCursorTest); |
| 115 }; | 115 }; |
| 116 | 116 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 cursor->GetBlob(env, NULL, 3); | 219 cursor->GetBlob(env, NULL, 3); |
| 220 std::vector<uint8_t> out; | 220 std::vector<uint8_t> out; |
| 221 base::android::JavaByteArrayToByteVector(env, data.obj(), &out); | 221 base::android::JavaByteArrayToByteVector(env, data.obj(), &out); |
| 222 EXPECT_EQ(data_bytes->data().size(), out.size()); | 222 EXPECT_EQ(data_bytes->data().size(), out.size()); |
| 223 EXPECT_EQ(data_bytes->data()[0], out[0]); | 223 EXPECT_EQ(data_bytes->data()[0], out[0]); |
| 224 cursor->Destroy(env, NULL); | 224 cursor->Destroy(env, NULL); |
| 225 // Cursor::Destroy posts the task in UI thread, run Message loop to release | 225 // Cursor::Destroy posts the task in UI thread, run Message loop to release |
| 226 // the statement, delete SQLiteCursor itself etc. | 226 // the statement, delete SQLiteCursor itself etc. |
| 227 content::RunAllPendingInMessageLoop(); | 227 content::RunAllPendingInMessageLoop(); |
| 228 } | 228 } |
| OLD | NEW |