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

Side by Side Diff: components/webdata/common/web_database_migration_unittest.cc

Issue 296593003: Make various string_util functions take StringPieces instead of char[]. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resync Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « components/cloud_devices/common/cloud_devices_urls.cc ('k') | extensions/common/permissions/socket_permission_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698