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/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 history_service_, row, url_index_->languages_, | 179 history_service_, row, url_index_->languages_, |
180 url_index_->scheme_whitelist_); | 180 url_index_->scheme_whitelist_); |
181 } | 181 } |
182 | 182 |
183 bool InMemoryURLIndexTest::DeleteURL(const GURL& url) { | 183 bool InMemoryURLIndexTest::DeleteURL(const GURL& url) { |
184 return GetPrivateData()->DeleteURL(url); | 184 return GetPrivateData()->DeleteURL(url); |
185 } | 185 } |
186 | 186 |
187 void InMemoryURLIndexTest::SetUp() { | 187 void InMemoryURLIndexTest::SetUp() { |
188 // We cannot access the database until the backend has been loaded. | 188 // We cannot access the database until the backend has been loaded. |
189 profile_.CreateHistoryService(true, false); | 189 ASSERT_TRUE(profile_.CreateHistoryService(true, false)); |
190 profile_.CreateBookmarkModel(true); | 190 profile_.CreateBookmarkModel(true); |
191 ui_test_utils::WaitForBookmarkModelToLoad(&profile_); | 191 ui_test_utils::WaitForBookmarkModelToLoad(&profile_); |
192 profile_.BlockUntilHistoryProcessesPendingRequests(); | 192 profile_.BlockUntilHistoryProcessesPendingRequests(); |
193 profile_.BlockUntilHistoryIndexIsRefreshed(); | 193 profile_.BlockUntilHistoryIndexIsRefreshed(); |
194 history_service_ = HistoryServiceFactory::GetForProfile( | 194 history_service_ = HistoryServiceFactory::GetForProfile( |
195 &profile_, Profile::EXPLICIT_ACCESS); | 195 &profile_, Profile::EXPLICIT_ACCESS); |
196 ASSERT_TRUE(history_service_); | 196 ASSERT_TRUE(history_service_); |
197 HistoryBackend* backend = history_service_->history_backend_.get(); | 197 HistoryBackend* backend = history_service_->history_backend_.get(); |
198 history_database_ = backend->db(); | 198 history_database_ = backend->db(); |
199 | 199 |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 full_file_path.GetComponents(&actual_parts); | 1170 full_file_path.GetComponents(&actual_parts); |
1171 ASSERT_EQ(expected_parts.size(), actual_parts.size()); | 1171 ASSERT_EQ(expected_parts.size(), actual_parts.size()); |
1172 size_t count = expected_parts.size(); | 1172 size_t count = expected_parts.size(); |
1173 for (size_t i = 0; i < count; ++i) | 1173 for (size_t i = 0; i < count; ++i) |
1174 EXPECT_EQ(expected_parts[i], actual_parts[i]); | 1174 EXPECT_EQ(expected_parts[i], actual_parts[i]); |
1175 // Must clear the history_dir_ to satisfy the dtor's DCHECK. | 1175 // Must clear the history_dir_ to satisfy the dtor's DCHECK. |
1176 set_history_dir(base::FilePath()); | 1176 set_history_dir(base::FilePath()); |
1177 } | 1177 } |
1178 | 1178 |
1179 } // namespace history | 1179 } // namespace history |
OLD | NEW |