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}
diff --git a/sql/sqlite_features_unittest.cc b/sql/sqlite_features_unittest.cc
index 2b95bb8d..20e002d 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 @@
   *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.