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/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 sql::MetaTable* meta_table) { | 150 sql::MetaTable* meta_table) { |
151 std::string value; | 151 std::string value; |
152 EXPECT_FALSE(meta_table->GetValue( | 152 EXPECT_FALSE(meta_table->GetValue( |
153 "Default Search Provider ID Backup", &value)); | 153 "Default Search Provider ID Backup", &value)); |
154 EXPECT_FALSE(meta_table->GetValue( | 154 EXPECT_FALSE(meta_table->GetValue( |
155 "Default Search Provider ID Backup Signature", &value)); | 155 "Default Search Provider ID Backup Signature", &value)); |
156 EXPECT_FALSE(connection.DoesTableExist("keywords_backup")); | 156 EXPECT_FALSE(connection.DoesTableExist("keywords_backup")); |
157 } | 157 } |
158 | 158 |
159 std::string RemoveQuotes(const std::string& has_quotes) { | 159 std::string RemoveQuotes(const std::string& has_quotes) { |
| 160 std::string no_quotes; |
160 // SQLite quotes: http://www.sqlite.org/lang_keywords.html | 161 // SQLite quotes: http://www.sqlite.org/lang_keywords.html |
161 static const char kQuotes[] = "\"[]`"; | 162 base::RemoveChars(has_quotes, "\"[]`", &no_quotes); |
162 std::string no_quotes; | |
163 base::RemoveChars(has_quotes, kQuotes, &no_quotes); | |
164 return no_quotes; | 163 return no_quotes; |
165 } | 164 } |
166 | 165 |
167 } // anonymous namespace | 166 } // anonymous namespace |
168 | 167 |
169 // The WebDatabaseMigrationTest encapsulates testing of database migrations. | 168 // The WebDatabaseMigrationTest encapsulates testing of database migrations. |
170 // Specifically, these tests are intended to exercise any schema changes in | 169 // Specifically, these tests are intended to exercise any schema changes in |
171 // the WebDatabase and data migrations that occur in | 170 // the WebDatabase and data migrations that occur in |
172 // |WebDatabase::MigrateOldVersionsAsNeeded()|. | 171 // |WebDatabase::MigrateOldVersionsAsNeeded()|. |
173 class WebDatabaseMigrationTest : public testing::Test { | 172 class WebDatabaseMigrationTest : public testing::Test { |
(...skipping 2490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2664 EXPECT_EQ(base::string16(), s_profiles.ColumnString16(7)); | 2663 EXPECT_EQ(base::string16(), s_profiles.ColumnString16(7)); |
2665 EXPECT_EQ(ASCIIToUTF16("US"), s_profiles.ColumnString16(8)); | 2664 EXPECT_EQ(ASCIIToUTF16("US"), s_profiles.ColumnString16(8)); |
2666 EXPECT_EQ(1395948829, s_profiles.ColumnInt(9)); | 2665 EXPECT_EQ(1395948829, s_profiles.ColumnInt(9)); |
2667 EXPECT_EQ(ASCIIToUTF16("Chrome settings"), s_profiles.ColumnString16(10)); | 2666 EXPECT_EQ(ASCIIToUTF16("Chrome settings"), s_profiles.ColumnString16(10)); |
2668 EXPECT_EQ(std::string(), s_profiles.ColumnString(11)); | 2667 EXPECT_EQ(std::string(), s_profiles.ColumnString(11)); |
2669 | 2668 |
2670 // No more entries expected. | 2669 // No more entries expected. |
2671 ASSERT_FALSE(s_profiles.Step()); | 2670 ASSERT_FALSE(s_profiles.Step()); |
2672 } | 2671 } |
2673 } | 2672 } |
OLD | NEW |