Index: sql/connection_unittest.cc |
diff --git a/sql/connection_unittest.cc b/sql/connection_unittest.cc |
index 773de5bcf5a3a75a308490f8d54f4e567baa7aed..565c12fb9ab113c781de7ebe4e29bd3edb530f8a 100644 |
--- a/sql/connection_unittest.cc |
+++ b/sql/connection_unittest.cc |
@@ -6,6 +6,7 @@ |
#include "base/scoped_temp_dir.h" |
#include "sql/connection.h" |
#include "sql/statement.h" |
+#include "sql/meta_table.h" |
#include "testing/gtest/include/gtest/gtest.h" |
#include "third_party/sqlite/sqlite3.h" |
@@ -259,6 +260,19 @@ TEST_F(SQLConnectionTest, RazeLocked) { |
ASSERT_TRUE(db().Raze()); |
} |
+#if defined(OS_ANDROID) |
+TEST_F(SQLConnectionTest, SetTempDirForSQL) { |
+ |
+ sql::MetaTable meta_table; |
+ // Below call needs a temporary directory in sqlite3 |
+ // On Android, it can pass only when the temporary directory is set. |
+ // Otherwise, sqlite3 doesn't find the correct directory to store |
+ // temporary files and will report the error 'unable to open |
+ // database file'. |
+ ASSERT_TRUE(meta_table.Init(&db(), 4, 4)); |
+} |
+#endif |
+ |
// TODO(shess): Spin up a background thread to hold other_db, to more |
// closely match real life. That would also allow testing |
// RazeWithTimeout(). |