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 <algorithm> | 5 #include <algorithm> |
6 #include <fstream> | 6 #include <fstream> |
7 | 7 |
8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 void InMemoryURLIndexTest::SetUp() { | 202 void InMemoryURLIndexTest::SetUp() { |
203 // We cannot access the database until the backend has been loaded. | 203 // We cannot access the database until the backend has been loaded. |
204 ASSERT_TRUE(profile_.CreateHistoryService(true, false)); | 204 ASSERT_TRUE(profile_.CreateHistoryService(true, false)); |
205 profile_.CreateBookmarkModel(true); | 205 profile_.CreateBookmarkModel(true); |
206 bookmarks::test::WaitForBookmarkModelToLoad( | 206 bookmarks::test::WaitForBookmarkModelToLoad( |
207 BookmarkModelFactory::GetForProfile(&profile_)); | 207 BookmarkModelFactory::GetForProfile(&profile_)); |
208 profile_.BlockUntilHistoryProcessesPendingRequests(); | 208 profile_.BlockUntilHistoryProcessesPendingRequests(); |
209 profile_.BlockUntilHistoryIndexIsRefreshed(); | 209 profile_.BlockUntilHistoryIndexIsRefreshed(); |
210 history_service_ = HistoryServiceFactory::GetForProfile( | 210 history_service_ = HistoryServiceFactory::GetForProfile( |
211 &profile_, Profile::EXPLICIT_ACCESS); | 211 &profile_, ServiceAccessType::EXPLICIT_ACCESS); |
212 ASSERT_TRUE(history_service_); | 212 ASSERT_TRUE(history_service_); |
213 HistoryBackend* backend = history_service_->history_backend_.get(); | 213 HistoryBackend* backend = history_service_->history_backend_.get(); |
214 history_database_ = backend->db(); | 214 history_database_ = backend->db(); |
215 | 215 |
216 // Create and populate a working copy of the URL history database. | 216 // Create and populate a working copy of the URL history database. |
217 base::FilePath history_proto_path; | 217 base::FilePath history_proto_path; |
218 PathService::Get(chrome::DIR_TEST_DATA, &history_proto_path); | 218 PathService::Get(chrome::DIR_TEST_DATA, &history_proto_path); |
219 history_proto_path = history_proto_path.Append( | 219 history_proto_path = history_proto_path.Append( |
220 FILE_PATH_LITERAL("History")); | 220 FILE_PATH_LITERAL("History")); |
221 history_proto_path = history_proto_path.Append(TestDBName()); | 221 history_proto_path = history_proto_path.Append(TestDBName()); |
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1228 full_file_path.GetComponents(&actual_parts); | 1228 full_file_path.GetComponents(&actual_parts); |
1229 ASSERT_EQ(expected_parts.size(), actual_parts.size()); | 1229 ASSERT_EQ(expected_parts.size(), actual_parts.size()); |
1230 size_t count = expected_parts.size(); | 1230 size_t count = expected_parts.size(); |
1231 for (size_t i = 0; i < count; ++i) | 1231 for (size_t i = 0; i < count; ++i) |
1232 EXPECT_EQ(expected_parts[i], actual_parts[i]); | 1232 EXPECT_EQ(expected_parts[i], actual_parts[i]); |
1233 // Must clear the history_dir_ to satisfy the dtor's DCHECK. | 1233 // Must clear the history_dir_ to satisfy the dtor's DCHECK. |
1234 set_history_dir(base::FilePath()); | 1234 set_history_dir(base::FilePath()); |
1235 } | 1235 } |
1236 | 1236 |
1237 } // namespace history | 1237 } // namespace history |
OLD | NEW |