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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
200 // Create and populate a working copy of the URL history database. | 200 // Create and populate a working copy of the URL history database. |
201 base::FilePath history_proto_path; | 201 base::FilePath history_proto_path; |
202 PathService::Get(chrome::DIR_TEST_DATA, &history_proto_path); | 202 PathService::Get(chrome::DIR_TEST_DATA, &history_proto_path); |
203 history_proto_path = history_proto_path.Append( | 203 history_proto_path = history_proto_path.Append( |
204 FILE_PATH_LITERAL("History")); | 204 FILE_PATH_LITERAL("History")); |
205 history_proto_path = history_proto_path.Append(TestDBName()); | 205 history_proto_path = history_proto_path.Append(TestDBName()); |
206 EXPECT_TRUE(file_util::PathExists(history_proto_path)); | 206 EXPECT_TRUE(base::PathExists(history_proto_path)); |
207 | 207 |
208 std::ifstream proto_file(history_proto_path.value().c_str()); | 208 std::ifstream proto_file(history_proto_path.value().c_str()); |
209 static const size_t kCommandBufferMaxSize = 2048; | 209 static const size_t kCommandBufferMaxSize = 2048; |
210 char sql_cmd_line[kCommandBufferMaxSize]; | 210 char sql_cmd_line[kCommandBufferMaxSize]; |
211 | 211 |
212 sql::Connection& db(GetDB()); | 212 sql::Connection& db(GetDB()); |
213 ASSERT_TRUE(db.is_open()); | 213 ASSERT_TRUE(db.is_open()); |
214 { | 214 { |
215 sql::Transaction transaction(&db); | 215 sql::Transaction transaction(&db); |
216 transaction.Begin(); | 216 transaction.Begin(); |
(...skipping 953 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 |