Index: sql/transaction_unittest.cc |
diff --git a/sql/transaction_unittest.cc b/sql/transaction_unittest.cc |
index 83d41259b2400380e98587266dc80a26eb1a8c94..179adcf3e55316a49ffb0d72d52a17c9c8021e8e 100644 |
--- a/sql/transaction_unittest.cc |
+++ b/sql/transaction_unittest.cc |
@@ -5,35 +5,26 @@ |
#include "base/files/file_util.h" |
#include "base/files/scoped_temp_dir.h" |
#include "sql/connection.h" |
+#include "sql/correct_sql_test_base.h" |
#include "sql/statement.h" |
#include "sql/transaction.h" |
#include "testing/gtest/include/gtest/gtest.h" |
#include "third_party/sqlite/sqlite3.h" |
-class SQLTransactionTest : public testing::Test { |
+class SQLTransactionTest : public sql::SQLTestBase { |
public: |
void SetUp() override { |
- ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
- ASSERT_TRUE(db_.Open( |
- temp_dir_.path().AppendASCII("SQLTransactionTest.db"))); |
+ SQLTestBase::SetUp(); |
ASSERT_TRUE(db().Execute("CREATE TABLE foo (a, b)")); |
} |
- void TearDown() override { db_.Close(); } |
- |
- sql::Connection& db() { return db_; } |
- |
// Returns the number of rows in table "foo". |
int CountFoo() { |
sql::Statement count(db().GetUniqueStatement("SELECT count(*) FROM foo")); |
count.Step(); |
return count.ColumnInt(0); |
} |
- |
- private: |
- base::ScopedTempDir temp_dir_; |
- sql::Connection db_; |
}; |
TEST_F(SQLTransactionTest, Commit) { |