OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "sql/connection.h" | 10 #include "sql/connection.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 private: | 75 private: |
76 FilePath path_; | 76 FilePath path_; |
77 sql::Connection db_; | 77 sql::Connection db_; |
78 scoped_refptr<StatementErrorHandler> error_handler_; | 78 scoped_refptr<StatementErrorHandler> error_handler_; |
79 }; | 79 }; |
80 | 80 |
81 // Do not include fts1 support, it is not useful, and nobody is | 81 // Do not include fts1 support, it is not useful, and nobody is |
82 // looking at it. | 82 // looking at it. |
83 TEST_F(SQLiteFeaturesTest, NoFTS1) { | 83 TEST_F(SQLiteFeaturesTest, NoFTS1) { |
84 ASSERT_FALSE(db().Execute("CREATE VIRTUAL TABLE foo USING fts1(x)")); | 84 ASSERT_EQ(SQLITE_ERROR, db().ExecuteAndReturnErrorCode( |
| 85 "CREATE VIRTUAL TABLE foo USING fts1(x)")); |
85 } | 86 } |
86 | 87 |
87 // fts2 is used for older history files, so we're signed on for | 88 // fts2 is used for older history files, so we're signed on for |
88 // keeping our version up-to-date. | 89 // keeping our version up-to-date. |
89 // TODO(shess): Think up a crazy way to get out from having to support | 90 // TODO(shess): Think up a crazy way to get out from having to support |
90 // this forever. | 91 // this forever. |
91 TEST_F(SQLiteFeaturesTest, FTS2) { | 92 TEST_F(SQLiteFeaturesTest, FTS2) { |
92 ASSERT_TRUE(db().Execute("CREATE VIRTUAL TABLE foo USING fts2(x)")); | 93 ASSERT_TRUE(db().Execute("CREATE VIRTUAL TABLE foo USING fts2(x)")); |
93 } | 94 } |
94 | 95 |
95 // fts3 is used for current history files, and also for WebDatabase. | 96 // fts3 is used for current history files, and also for WebDatabase. |
96 TEST_F(SQLiteFeaturesTest, FTS3) { | 97 TEST_F(SQLiteFeaturesTest, FTS3) { |
97 ASSERT_TRUE(db().Execute("CREATE VIRTUAL TABLE foo USING fts3(x)")); | 98 ASSERT_TRUE(db().Execute("CREATE VIRTUAL TABLE foo USING fts3(x)")); |
98 } | 99 } |
99 | 100 |
100 } // namespace | 101 } // namespace |
OLD | NEW |