summaryrefslogtreecommitdiffstats
path: root/sql/recovery_unittest.cc
diff options
context:
space:
mode:
authorerg <erg@chromium.org>2015-06-19 18:38:13 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-20 01:38:55 +0000
commit102ceb4133685db70ac15cb5bcb134a85736fe86 (patch)
treeb902e100529fe3675e293c49c70eed32c430daf7 /sql/recovery_unittest.cc
parent55002d65c4a31e6b386cbe9dc02dfaa24d3fb42d (diff)
downloadchromium_src-102ceb4133685db70ac15cb5bcb134a85736fe86.zip
chromium_src-102ceb4133685db70ac15cb5bcb134a85736fe86.tar.gz
chromium_src-102ceb4133685db70ac15cb5bcb134a85736fe86.tar.bz2
mandoline filesystem: add a sqlite3 vfs to proxy filesystem usage.
This adds a //sql/mojo library which can be linked into preexisting sqlite3 code which adds a new VFS which transparently proxies filesystem usage to the mojo:filesystem application. We create a new sql_apptests.mojo target, which currently has all the sql connection_unittests.cc (minus 2 hard ones), all statement and transaction unit tests and refactor the sql testing stuff so that we have two implementations of an SQLTestBase class: one that uses files raw and one that proxies to the filesystem process. Notably, this patch does not implement file locking, which will have to be implemented before we can safely use this, but will be a large enough patch in and of itself that I'm punting on it for this patch. BUG=493311 Review URL: https://codereview.chromium.org/1176653002 Cr-Commit-Position: refs/heads/master@{#335415}
Diffstat (limited to 'sql/recovery_unittest.cc')
-rw-r--r--sql/recovery_unittest.cc28
1 files changed, 2 insertions, 26 deletions
diff --git a/sql/recovery_unittest.cc b/sql/recovery_unittest.cc
index 78a1478..1f930cb 100644
--- a/sql/recovery_unittest.cc
+++ b/sql/recovery_unittest.cc
@@ -16,6 +16,7 @@
#include "sql/statement.h"
#include "sql/test/paths.h"
#include "sql/test/scoped_error_ignorer.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"
@@ -61,32 +62,7 @@ std::string GetSchema(sql::Connection* db) {
return ExecuteWithResults(db, kSql, "|", "\n");
}
-class SQLRecoveryTest : public testing::Test {
- public:
- SQLRecoveryTest() {}
-
- void SetUp() override {
- ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- ASSERT_TRUE(db_.Open(db_path()));
- }
-
- void TearDown() override { db_.Close(); }
-
- sql::Connection& db() { return db_; }
-
- base::FilePath db_path() {
- return temp_dir_.path().AppendASCII("SQLRecoveryTest.db");
- }
-
- bool Reopen() {
- db_.Close();
- return db_.Open(db_path());
- }
-
- private:
- base::ScopedTempDir temp_dir_;
- sql::Connection db_;
-};
+using SQLRecoveryTest = sql::SQLTestBase;
TEST_F(SQLRecoveryTest, RecoverBasic) {
const char kCreateSql[] = "CREATE TABLE x (t TEXT)";