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

Unified Diff: sql/connection_unittest.cc

Issue 23649002: Unit tests for sql::MetaTable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Greg's points. Created 7 years, 4 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 | « no previous file | sql/meta_table_unittest.cc » ('j') | 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 09a47fb47fddca6f0954608a1a9d95ff52f11711..445db3459bdfa972a6211bd51917a5202c3095f5 100644
--- a/sql/connection_unittest.cc
+++ b/sql/connection_unittest.cc
@@ -88,11 +88,10 @@ class ScopedUmaskSetter {
class SQLConnectionTest : public testing::Test {
public:
- SQLConnectionTest() {}
-
virtual void SetUp() {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- ASSERT_TRUE(db_.Open(db_path()));
+ db_path_ = temp_dir_.path().AppendASCII("SQLConnectionTest.db");
+ ASSERT_TRUE(db_.Open(db_path_));
}
virtual void TearDown() {
@@ -100,10 +99,7 @@ class SQLConnectionTest : public testing::Test {
}
sql::Connection& db() { return db_; }
-
- base::FilePath db_path() {
- return temp_dir_.path().AppendASCII("SQLConnectionTest.db");
- }
+ const base::FilePath& db_path() { return db_path_; }
Greg Billock 2013/09/06 16:02:10 Here it gets used in tests. So having both in the
// Handle errors by blowing away the database.
void RazeErrorCallback(int expected_error, int error, sql::Statement* stmt) {
@@ -112,8 +108,9 @@ class SQLConnectionTest : public testing::Test {
}
private:
- base::ScopedTempDir temp_dir_;
sql::Connection db_;
+ base::FilePath db_path_;
+ base::ScopedTempDir temp_dir_;
};
TEST_F(SQLConnectionTest, Execute) {
« no previous file with comments | « no previous file | sql/meta_table_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698