OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/history/core/test/database_test_utils.h" |
| 6 |
| 7 #include "base/files/file_path.h" |
| 8 #include "base/path_service.h" |
| 9 #include "sql/test/test_helpers.h" |
| 10 |
| 11 namespace history { |
| 12 |
| 13 namespace { |
| 14 |
| 15 WARN_UNUSED_RESULT bool GetTestDataHistoryDir(base::FilePath* dir) { |
| 16 if (!PathService::Get(base::DIR_SOURCE_ROOT, dir)) |
| 17 return false; |
| 18 *dir = dir->AppendASCII("components"); |
| 19 *dir = dir->AppendASCII("test"); |
| 20 *dir = dir->AppendASCII("data"); |
| 21 *dir = dir->AppendASCII("history"); |
| 22 return true; |
| 23 } |
| 24 |
| 25 } // namespace |
| 26 |
| 27 WARN_UNUSED_RESULT bool CreateDatabaseFromSQL(const base::FilePath& db_path, |
| 28 const char* ascii_path) { |
| 29 base::FilePath dir; |
| 30 if (!GetTestDataHistoryDir(&dir)) |
| 31 return false; |
| 32 return sql::test::CreateDatabaseFromSQL(db_path, dir.AppendASCII(ascii_path)); |
| 33 } |
| 34 |
| 35 } // namespace history |
OLD | NEW |