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/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 bool InMemoryURLIndexTest::DeleteURL(const GURL& url) { | 179 bool InMemoryURLIndexTest::DeleteURL(const GURL& url) { |
180 return GetPrivateData()->DeleteURL(url); | 180 return GetPrivateData()->DeleteURL(url); |
181 } | 181 } |
182 | 182 |
183 void InMemoryURLIndexTest::SetUp() { | 183 void InMemoryURLIndexTest::SetUp() { |
184 // We cannot access the database until the backend has been loaded. | 184 // We cannot access the database until the backend has been loaded. |
185 profile_.CreateHistoryService(true, false); | 185 profile_.CreateHistoryService(true, false); |
186 profile_.CreateBookmarkModel(true); | 186 profile_.CreateBookmarkModel(true); |
187 profile_.BlockUntilBookmarkModelLoaded(); | 187 profile_.BlockUntilBookmarkModelLoaded(); |
188 profile_.BlockUntilHistoryProcessesPendingRequests(); | 188 profile_.BlockUntilHistoryProcessesPendingRequests(); |
| 189 profile_.BlockUntilHistoryIndexIsRefreshed(); |
189 HistoryService* history_service = | 190 HistoryService* history_service = |
190 HistoryServiceFactory::GetForProfile(&profile_, | 191 HistoryServiceFactory::GetForProfile(&profile_, |
191 Profile::EXPLICIT_ACCESS); | 192 Profile::EXPLICIT_ACCESS); |
192 ASSERT_TRUE(history_service); | 193 ASSERT_TRUE(history_service); |
193 HistoryBackend* backend = history_service->history_backend_.get(); | 194 HistoryBackend* backend = history_service->history_backend_.get(); |
194 history_database_ = backend->db(); | 195 history_database_ = backend->db(); |
195 | 196 |
196 // Create and populate a working copy of the URL history database. | 197 // Create and populate a working copy of the URL history database. |
197 FilePath history_proto_path; | 198 FilePath history_proto_path; |
198 PathService::Get(chrome::DIR_TEST_DATA, &history_proto_path); | 199 PathService::Get(chrome::DIR_TEST_DATA, &history_proto_path); |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 full_file_path.GetComponents(&actual_parts); | 948 full_file_path.GetComponents(&actual_parts); |
948 ASSERT_EQ(expected_parts.size(), actual_parts.size()); | 949 ASSERT_EQ(expected_parts.size(), actual_parts.size()); |
949 size_t count = expected_parts.size(); | 950 size_t count = expected_parts.size(); |
950 for (size_t i = 0; i < count; ++i) | 951 for (size_t i = 0; i < count; ++i) |
951 EXPECT_EQ(expected_parts[i], actual_parts[i]); | 952 EXPECT_EQ(expected_parts[i], actual_parts[i]); |
952 // Must clear the history_dir_ to satisfy the dtor's DCHECK. | 953 // Must clear the history_dir_ to satisfy the dtor's DCHECK. |
953 set_history_dir(FilePath()); | 954 set_history_dir(FilePath()); |
954 } | 955 } |
955 | 956 |
956 } // namespace history | 957 } // namespace history |
OLD | NEW |