| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/sql/connection.h" | 5 #include "app/sql/connection.h" |
| 6 #include "app/sql/statement.h" | 6 #include "app/sql/statement.h" |
| 7 #include "app/sql/transaction.h" | 7 #include "app/sql/transaction.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "third_party/sqlite/preprocessed/sqlite3.h" | 12 #include "third_party/sqlite/sqlite3.h" |
| 13 | 13 |
| 14 class SQLTransactionTest : public testing::Test { | 14 class SQLTransactionTest : public testing::Test { |
| 15 public: | 15 public: |
| 16 SQLTransactionTest() {} | 16 SQLTransactionTest() {} |
| 17 | 17 |
| 18 void SetUp() { | 18 void SetUp() { |
| 19 ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &path_)); | 19 ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &path_)); |
| 20 path_ = path_.AppendASCII("SQLStatementTest.db"); | 20 path_ = path_.AppendASCII("SQLStatementTest.db"); |
| 21 file_util::Delete(path_, false); | 21 file_util::Delete(path_, false); |
| 22 ASSERT_TRUE(db_.Open(path_)); | 22 ASSERT_TRUE(db_.Open(path_)); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 EXPECT_EQ(1, db().transaction_nesting()); | 130 EXPECT_EQ(1, db().transaction_nesting()); |
| 131 { | 131 { |
| 132 sql::Transaction inner3(&db()); | 132 sql::Transaction inner3(&db()); |
| 133 EXPECT_FALSE(inner3.Begin()); | 133 EXPECT_FALSE(inner3.Begin()); |
| 134 EXPECT_EQ(1, db().transaction_nesting()); | 134 EXPECT_EQ(1, db().transaction_nesting()); |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 EXPECT_EQ(0, db().transaction_nesting()); | 137 EXPECT_EQ(0, db().transaction_nesting()); |
| 138 EXPECT_EQ(0, CountFoo()); | 138 EXPECT_EQ(0, CountFoo()); |
| 139 } | 139 } |
| OLD | NEW |