Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Unified Diff: sql/connection_unittest.cc

Issue 9839021: Reset needs_rollback after rollback. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sql/connection.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/connection_unittest.cc
diff --git a/sql/connection_unittest.cc b/sql/connection_unittest.cc
index 9718ce0042ff16c658ace47c2fd11832287ff36f..60011417dfb5a7170965d228d52e4569e4c0840d 100644
--- a/sql/connection_unittest.cc
+++ b/sql/connection_unittest.cc
@@ -120,3 +120,12 @@ TEST_F(SQLConnectionTest, GetLastInsertRowId) {
ASSERT_TRUE(s.Step());
EXPECT_EQ(12, s.ColumnInt(0));
}
+
+TEST_F(SQLConnectionTest, Rollback) {
+ ASSERT_TRUE(db().BeginTransaction());
+ ASSERT_TRUE(db().BeginTransaction());
+ EXPECT_EQ(2, db().transaction_nesting());
+ db().RollbackTransaction();
+ EXPECT_FALSE(db().CommitTransaction());
+ EXPECT_TRUE(db().BeginTransaction());
+}
« no previous file with comments | « sql/connection.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698