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

Unified Diff: sql/sqlite_features_unittest.cc

Issue 1176653002: mandoline filesystem: add a sqlite3 vfs to proxy filesystem usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with ToT and fix the test import. Created 5 years, 6 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
Index: sql/sqlite_features_unittest.cc
diff --git a/sql/sqlite_features_unittest.cc b/sql/sqlite_features_unittest.cc
index 2b95bb8d3e72165b9fc47258a6f13ec5df4895ba..20e002d3916477a747b01a70e2451229f773d0f4 100644
--- a/sql/sqlite_features_unittest.cc
+++ b/sql/sqlite_features_unittest.cc
@@ -9,6 +9,7 @@
#include "base/files/scoped_temp_dir.h"
#include "sql/connection.h"
#include "sql/statement.h"
+#include "sql/test/sql_test_base.h"
#include "sql/test/test_helpers.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/sqlite/sqlite3.h"
@@ -24,34 +25,30 @@ void CaptureErrorCallback(int* error_pointer, std::string* sql_text,
*sql_text = text ? text : "no statement available";
}
-class SQLiteFeaturesTest : public testing::Test {
+class SQLiteFeaturesTest : public sql::SQLTestBase {
public:
SQLiteFeaturesTest() : error_(SQLITE_OK) {}
void SetUp() override {
- ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- ASSERT_TRUE(db_.Open(temp_dir_.path().AppendASCII("SQLStatementTest.db")));
+ SQLTestBase::SetUp();
// The error delegate will set |error_| and |sql_text_| when any sqlite
// statement operation returns an error code.
- db_.set_error_callback(base::Bind(&CaptureErrorCallback,
- &error_, &sql_text_));
+ db().set_error_callback(
+ base::Bind(&CaptureErrorCallback, &error_, &sql_text_));
}
void TearDown() override {
// If any error happened the original sql statement can be found in
// |sql_text_|.
EXPECT_EQ(SQLITE_OK, error_) << sql_text_;
- db_.Close();
+
+ SQLTestBase::TearDown();
}
- sql::Connection& db() { return db_; }
int error() { return error_; }
private:
- base::ScopedTempDir temp_dir_;
- sql::Connection db_;
-
// The error code of the most recent error.
int error_;
// Original statement which has caused the error.

Powered by Google App Engine
This is Rietveld 408576698