| 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" |
| 11 #include "chrome/common/chrome_constants.h" | 11 #include "chrome/common/chrome_constants.h" |
| 12 #include "chrome/test/base/testing_browser_process.h" | 12 #include "chrome/test/base/testing_browser_process.h" |
| 13 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
| 14 #include "chrome/test/base/testing_profile_manager.h" | 14 #include "chrome/test/base/testing_profile_manager.h" |
| 15 #include "components/bookmarks/browser/bookmark_model.h" | 15 #include "components/bookmarks/browser/bookmark_model.h" |
| 16 #include "components/bookmarks/test/bookmark_test_helpers.h" | 16 #include "components/bookmarks/test/bookmark_test_helpers.h" |
| 17 #include "components/history/core/browser/history_constants.h" | 17 #include "components/history/core/browser/history_constants.h" |
| 18 #include "components/history/core/browser/history_database.h" | 18 #include "components/history/core/browser/history_database.h" |
| 19 #include "components/history/core/test/test_history_database.h" | 19 #include "components/history/core/test/test_history_database.h" |
| 20 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
| 21 #include "content/public/test/test_browser_thread.h" | 21 #include "content/public/test/test_browser_thread.h" |
| 22 #include "content/public/test/test_utils.h" | 22 #include "content/public/test/test_utils.h" |
| 23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 24 | 24 |
| 25 using bookmarks::BookmarkModel; | 25 using bookmarks::BookmarkModel; |
| 26 using bookmarks::BookmarkNode; |
| 26 using content::BrowserThread; | 27 using content::BrowserThread; |
| 27 | 28 |
| 28 namespace history { | 29 namespace history { |
| 29 | 30 |
| 30 class BookmarkModelSQLHandlerTest : public testing::Test { | 31 class BookmarkModelSQLHandlerTest : public testing::Test { |
| 31 public: | 32 public: |
| 32 BookmarkModelSQLHandlerTest() | 33 BookmarkModelSQLHandlerTest() |
| 33 : profile_manager_(TestingBrowserProcess::GetGlobal()), | 34 : profile_manager_(TestingBrowserProcess::GetGlobal()), |
| 34 bookmark_model_(NULL), | 35 bookmark_model_(NULL), |
| 35 ui_thread_(BrowserThread::UI, &message_loop_), | 36 ui_thread_(BrowserThread::UI, &message_loop_), |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 id_row.url = url1; | 246 id_row.url = url1; |
| 246 id_rows.clear(); | 247 id_rows.clear(); |
| 247 id_rows.push_back(id_row); | 248 id_rows.push_back(id_row); |
| 248 ASSERT_TRUE(handler.Delete(id_rows)); | 249 ASSERT_TRUE(handler.Delete(id_rows)); |
| 249 RunMessageLoopForUI(); | 250 RunMessageLoopForUI(); |
| 250 // All bookmarks were deleted. | 251 // All bookmarks were deleted. |
| 251 EXPECT_FALSE(bookmark_model_->HasBookmarks()); | 252 EXPECT_FALSE(bookmark_model_->HasBookmarks()); |
| 252 } | 253 } |
| 253 | 254 |
| 254 } // namespace history | 255 } // namespace history |
| OLD | NEW |