Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(526)

Side by Side Diff: chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc

Issue 722723005: Move constants used by history component to history namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android build failures Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/history/history_database.h" 10 #include "chrome/browser/history/history_database.h"
11 #include "chrome/browser/profiles/profile_manager.h" 11 #include "chrome/browser/profiles/profile_manager.h"
12 #include "chrome/common/chrome_constants.h" 12 #include "chrome/common/chrome_constants.h"
13 #include "chrome/test/base/testing_browser_process.h" 13 #include "chrome/test/base/testing_browser_process.h"
14 #include "chrome/test/base/testing_profile.h" 14 #include "chrome/test/base/testing_profile.h"
15 #include "chrome/test/base/testing_profile_manager.h" 15 #include "chrome/test/base/testing_profile_manager.h"
16 #include "components/bookmarks/browser/bookmark_model.h" 16 #include "components/bookmarks/browser/bookmark_model.h"
17 #include "components/bookmarks/test/bookmark_test_helpers.h" 17 #include "components/bookmarks/test/bookmark_test_helpers.h"
18 #include "components/history/core/browser/history_constants.h"
18 #include "content/public/browser/browser_thread.h" 19 #include "content/public/browser/browser_thread.h"
19 #include "content/public/test/test_browser_thread.h" 20 #include "content/public/test/test_browser_thread.h"
20 #include "content/public/test/test_utils.h" 21 #include "content/public/test/test_utils.h"
21 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
22 23
23 namespace history { 24 namespace history {
24 25
25 using content::BrowserThread; 26 using content::BrowserThread;
26 27
27 class BookmarkModelSQLHandlerTest : public testing::Test { 28 class BookmarkModelSQLHandlerTest : public testing::Test {
(...skipping 21 matching lines...) Expand all
49 bookmark_model_ = BookmarkModelFactory::GetForProfile(testing_profile); 50 bookmark_model_ = BookmarkModelFactory::GetForProfile(testing_profile);
50 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model_); 51 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model_);
51 ASSERT_TRUE(bookmark_model_); 52 ASSERT_TRUE(bookmark_model_);
52 // Get the BookmarkModel from LastUsedProfile, this is the same way that 53 // Get the BookmarkModel from LastUsedProfile, this is the same way that
53 // how the BookmarkModelSQLHandler gets the BookmarkModel. 54 // how the BookmarkModelSQLHandler gets the BookmarkModel.
54 Profile* profile = ProfileManager::GetLastUsedProfile(); 55 Profile* profile = ProfileManager::GetLastUsedProfile();
55 ASSERT_TRUE(profile); 56 ASSERT_TRUE(profile);
56 57
57 // Create the directory for history database. 58 // Create the directory for history database.
58 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 59 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
59 base::FilePath history_db_name = temp_dir_.path().AppendASCII( 60 base::FilePath history_db_name =
60 chrome::kHistoryFilename); 61 temp_dir_.path().AppendASCII(kHistoryFilename);
61 history_db_.Init(history_db_name); 62 history_db_.Init(history_db_name);
62 } 63 }
63 64
64 // Runs the MessageLoopForUI, and return till all pending messages were 65 // Runs the MessageLoopForUI, and return till all pending messages were
65 // processed. 66 // processed.
66 void RunMessageLoopForUI() { 67 void RunMessageLoopForUI() {
67 content::RunAllPendingInMessageLoop(); 68 content::RunAllPendingInMessageLoop();
68 } 69 }
69 70
70 TestingProfileManager profile_manager_; 71 TestingProfileManager profile_manager_;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 id_row.url = url1; 245 id_row.url = url1;
245 id_rows.clear(); 246 id_rows.clear();
246 id_rows.push_back(id_row); 247 id_rows.push_back(id_row);
247 ASSERT_TRUE(handler.Delete(id_rows)); 248 ASSERT_TRUE(handler.Delete(id_rows));
248 RunMessageLoopForUI(); 249 RunMessageLoopForUI();
249 // All bookmarks were deleted. 250 // All bookmarks were deleted.
250 EXPECT_FALSE(bookmark_model_->HasBookmarks()); 251 EXPECT_FALSE(bookmark_model_->HasBookmarks());
251 } 252 }
252 253
253 } // namespace history 254 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698