OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 "sql/test/sql_test_base.h" | 5 #include "sql/test/sql_test_base.h" |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "sql/test/test_helpers.h" | 8 #include "sql/test/test_helpers.h" |
9 | 9 |
10 namespace sql { | 10 namespace sql { |
11 | 11 |
12 SQLTestBase::SQLTestBase() { | 12 SQLTestBase::SQLTestBase() { |
13 } | 13 } |
14 | 14 |
15 SQLTestBase::~SQLTestBase() { | 15 SQLTestBase::~SQLTestBase() { |
16 } | 16 } |
17 | 17 |
18 base::FilePath SQLTestBase::db_path() { | 18 base::FilePath SQLTestBase::db_path() { |
19 return temp_dir_.path().AppendASCII("SQLTest.db"); | 19 return temp_dir_.GetPath().AppendASCII("SQLTest.db"); |
20 } | 20 } |
21 | 21 |
22 sql::Connection& SQLTestBase::db() { | 22 sql::Connection& SQLTestBase::db() { |
23 return db_; | 23 return db_; |
24 } | 24 } |
25 | 25 |
26 bool SQLTestBase::Reopen() { | 26 bool SQLTestBase::Reopen() { |
27 db_.Close(); | 27 db_.Close(); |
28 return db_.Open(db_path()); | 28 return db_.Open(db_path()); |
29 } | 29 } |
(...skipping 27 matching lines...) Expand all Loading... |
57 void SQLTestBase::SetUp() { | 57 void SQLTestBase::SetUp() { |
58 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 58 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
59 ASSERT_TRUE(db_.Open(db_path())); | 59 ASSERT_TRUE(db_.Open(db_path())); |
60 } | 60 } |
61 | 61 |
62 void SQLTestBase::TearDown() { | 62 void SQLTestBase::TearDown() { |
63 db_.Close(); | 63 db_.Close(); |
64 } | 64 } |
65 | 65 |
66 } // namespace sql | 66 } // namespace sql |
OLD | NEW |