| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "sql/connection.h" | 10 #include "sql/connection.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 virtual void TearDown() { | 40 virtual void TearDown() { |
| 41 // If any error happened the original sql statement can be found in | 41 // If any error happened the original sql statement can be found in |
| 42 // |sql_text_|. | 42 // |sql_text_|. |
| 43 EXPECT_EQ(SQLITE_OK, error_); | 43 EXPECT_EQ(SQLITE_OK, error_); |
| 44 db_.Close(); | 44 db_.Close(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 sql::Connection& db() { return db_; } | 47 sql::Connection& db() { return db_; } |
| 48 | 48 |
| 49 int sqlite_error() const { | |
| 50 return error_; | |
| 51 } | |
| 52 | |
| 53 private: | 49 private: |
| 54 base::ScopedTempDir temp_dir_; | 50 base::ScopedTempDir temp_dir_; |
| 55 sql::Connection db_; | 51 sql::Connection db_; |
| 56 | 52 |
| 57 // The error code of the most recent error. | 53 // The error code of the most recent error. |
| 58 int error_; | 54 int error_; |
| 59 // Original statement which has caused the error. | 55 // Original statement which has caused the error. |
| 60 std::string sql_text_; | 56 std::string sql_text_; |
| 61 }; | 57 }; |
| 62 | 58 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 77 ASSERT_TRUE(db().Execute("CREATE VIRTUAL TABLE foo USING fts2(x)")); | 73 ASSERT_TRUE(db().Execute("CREATE VIRTUAL TABLE foo USING fts2(x)")); |
| 78 } | 74 } |
| 79 #endif | 75 #endif |
| 80 | 76 |
| 81 // fts3 is used for current history files, and also for WebDatabase. | 77 // fts3 is used for current history files, and also for WebDatabase. |
| 82 TEST_F(SQLiteFeaturesTest, FTS3) { | 78 TEST_F(SQLiteFeaturesTest, FTS3) { |
| 83 ASSERT_TRUE(db().Execute("CREATE VIRTUAL TABLE foo USING fts3(x)")); | 79 ASSERT_TRUE(db().Execute("CREATE VIRTUAL TABLE foo USING fts3(x)")); |
| 84 } | 80 } |
| 85 | 81 |
| 86 } // namespace | 82 } // namespace |
| OLD | NEW |