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/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 namespace history { | 28 namespace history { |
29 | 29 |
30 class BookmarkModelSQLHandlerTest : public testing::Test { | 30 class BookmarkModelSQLHandlerTest : public testing::Test { |
31 public: | 31 public: |
32 BookmarkModelSQLHandlerTest() | 32 BookmarkModelSQLHandlerTest() |
33 : profile_manager_(TestingBrowserProcess::GetGlobal()), | 33 : profile_manager_(TestingBrowserProcess::GetGlobal()), |
34 bookmark_model_(NULL), | 34 bookmark_model_(NULL), |
35 ui_thread_(BrowserThread::UI, &message_loop_), | 35 ui_thread_(BrowserThread::UI, &message_loop_), |
36 file_thread_(BrowserThread::FILE, &message_loop_) {} | 36 file_thread_(BrowserThread::FILE, &message_loop_) {} |
37 virtual ~BookmarkModelSQLHandlerTest() {} | 37 ~BookmarkModelSQLHandlerTest() override {} |
38 | 38 |
39 protected: | 39 protected: |
40 virtual void SetUp() override { | 40 void SetUp() override { |
41 // Setup the testing profile, so the bookmark_model_sql_handler could | 41 // Setup the testing profile, so the bookmark_model_sql_handler could |
42 // get the bookmark model from it. | 42 // get the bookmark model from it. |
43 ASSERT_TRUE(profile_manager_.SetUp()); | 43 ASSERT_TRUE(profile_manager_.SetUp()); |
44 // It seems that the name has to be chrome::kInitialProfile, so it | 44 // It seems that the name has to be chrome::kInitialProfile, so it |
45 // could be found by ProfileManager::GetLastUsedProfile(). | 45 // could be found by ProfileManager::GetLastUsedProfile(). |
46 TestingProfile* testing_profile = profile_manager_.CreateTestingProfile( | 46 TestingProfile* testing_profile = profile_manager_.CreateTestingProfile( |
47 chrome::kInitialProfile); | 47 chrome::kInitialProfile); |
48 // Create the BookmarkModel that doesn't need to invoke load(). | 48 // Create the BookmarkModel that doesn't need to invoke load(). |
49 testing_profile->CreateBookmarkModel(true); | 49 testing_profile->CreateBookmarkModel(true); |
50 bookmark_model_ = BookmarkModelFactory::GetForProfile(testing_profile); | 50 bookmark_model_ = BookmarkModelFactory::GetForProfile(testing_profile); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 id_row.url = url1; | 245 id_row.url = url1; |
246 id_rows.clear(); | 246 id_rows.clear(); |
247 id_rows.push_back(id_row); | 247 id_rows.push_back(id_row); |
248 ASSERT_TRUE(handler.Delete(id_rows)); | 248 ASSERT_TRUE(handler.Delete(id_rows)); |
249 RunMessageLoopForUI(); | 249 RunMessageLoopForUI(); |
250 // All bookmarks were deleted. | 250 // All bookmarks were deleted. |
251 EXPECT_FALSE(bookmark_model_->HasBookmarks()); | 251 EXPECT_FALSE(bookmark_model_->HasBookmarks()); |
252 } | 252 } |
253 | 253 |
254 } // namespace history | 254 } // namespace history |
OLD | NEW |