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

Unified Diff: sql/connection_unittest.cc

Issue 10809015: Fix the sqlite errors of content unittests on Android (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebase Created 8 years, 5 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 | « build/android/gtest_filter/content_unittests_disabled ('k') | third_party/sqlite/README.chromium » ('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 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().
« no previous file with comments | « build/android/gtest_filter/content_unittests_disabled ('k') | third_party/sqlite/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698