Commit 8891a429 authored by jhawkins@chromium.org's avatar jhawkins@chromium.org

Autofill: Check for different string sizes when comparing for equality.

Also uses StringToLowerASCII for consistency with AF code. Fixes a crash under Win Dbg.

BUG=92937
TEST=WebDatabaseMigrationTest.MigrateVersion32ToCurrent

R=dhollowa@chromium.org


Review URL: http://codereview.chromium.org/7645038

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97108 0039d316-1c4b-4281-b951-d872f2087c98
parent 5a9ff1dc
...@@ -543,8 +543,8 @@ struct CaseInsensitiveStringEquals ...@@ -543,8 +543,8 @@ struct CaseInsensitiveStringEquals
: public std::binary_function<string16, string16, bool> : public std::binary_function<string16, string16, bool>
{ {
bool operator()(const string16& x, const string16& y) const { bool operator()(const string16& x, const string16& y) const {
return std::equal(x.begin(), x.end(), y.begin(), if (x.size() != y.size()) return false;
base::CaseInsensitiveCompare<string16::value_type>()); return StringToLowerASCII(x) == StringToLowerASCII(y);
} }
}; };
......
...@@ -909,16 +909,9 @@ TEST_F(WebDatabaseMigrationTest, MigrateVersion31ToCurrent) { ...@@ -909,16 +909,9 @@ TEST_F(WebDatabaseMigrationTest, MigrateVersion31ToCurrent) {
} }
} }
// Crashes on Win. http://crbug.com/92937
#if defined(OS_WIN)
#define MAYBE_MigrateVersion32ToCurrent DISABLED_MigrateVersion32ToCurrent
#else
#define MAYBE_MigrateVersion32ToCurrent MigrateVersion32ToCurrent
#endif // defined(OS_WIN)
// Factor |autofill_profiles| address information separately from name, email, // Factor |autofill_profiles| address information separately from name, email,
// and phone. // and phone.
TEST_F(WebDatabaseMigrationTest, MAYBE_MigrateVersion32ToCurrent) { TEST_F(WebDatabaseMigrationTest, MigrateVersion32ToCurrent) {
// Initialize the database. // Initialize the database.
ASSERT_NO_FATAL_FAILURE(LoadDatabase(FILE_PATH_LITERAL("version_32.sql"))); ASSERT_NO_FATAL_FAILURE(LoadDatabase(FILE_PATH_LITERAL("version_32.sql")));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment