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/bookmark_model_sql_handler.h" | 5 #include "chrome/browser/history/android/bookmark_model_sql_handler.h" |
6 | 6 |
7 #include "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
10 #include "chrome/browser/history/history_database.h" | 10 #include "chrome/browser/history/history_database.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // Create the directory for history database. | 56 // Create the directory for history database. |
57 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 57 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
58 FilePath history_db_name = temp_dir_.path().AppendASCII( | 58 FilePath history_db_name = temp_dir_.path().AppendASCII( |
59 chrome::kHistoryFilename); | 59 chrome::kHistoryFilename); |
60 history_db_.Init(history_db_name, temp_dir_.path()); | 60 history_db_.Init(history_db_name, temp_dir_.path()); |
61 } | 61 } |
62 | 62 |
63 // Runs the MessageLoopForUI, and return till all pending messages were | 63 // Runs the MessageLoopForUI, and return till all pending messages were |
64 // processed. | 64 // processed. |
65 void RunMessageLoopForUI() { | 65 void RunMessageLoopForUI() { |
66 ui_test_utils::RunAllPendingInMessageLoop(); | 66 content::RunAllPendingInMessageLoop(); |
67 } | 67 } |
68 | 68 |
69 TestingProfileManager profile_manager_; | 69 TestingProfileManager profile_manager_; |
70 BookmarkModel* bookmark_model_; | 70 BookmarkModel* bookmark_model_; |
71 MessageLoopForUI message_loop_; | 71 MessageLoopForUI message_loop_; |
72 content::TestBrowserThread ui_thread_; | 72 content::TestBrowserThread ui_thread_; |
73 content::TestBrowserThread file_thread_; | 73 content::TestBrowserThread file_thread_; |
74 ScopedTempDir temp_dir_; | 74 ScopedTempDir temp_dir_; |
75 HistoryDatabase history_db_; | 75 HistoryDatabase history_db_; |
76 }; | 76 }; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 id_row.url = url1; | 239 id_row.url = url1; |
240 id_rows.clear(); | 240 id_rows.clear(); |
241 id_rows.push_back(id_row); | 241 id_rows.push_back(id_row); |
242 ASSERT_TRUE(handler.Delete(id_rows)); | 242 ASSERT_TRUE(handler.Delete(id_rows)); |
243 RunMessageLoopForUI(); | 243 RunMessageLoopForUI(); |
244 // All bookmarks were deleted. | 244 // All bookmarks were deleted. |
245 EXPECT_FALSE(bookmark_model_->HasBookmarks()); | 245 EXPECT_FALSE(bookmark_model_->HasBookmarks()); |
246 } | 246 } |
247 | 247 |
248 } // namespace history | 248 } // namespace history |
OLD | NEW |