diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-20 19:25:42 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-20 19:25:42 +0000 |
commit | 00e3f152083aea092353b3d284c368b48136f33c (patch) | |
tree | 081df57119ba9301bebd7c7091efc4acab5accc9 /chrome/browser/webdata/web_database_unittest.cc | |
parent | 4e6f2f037e6d1956bc431ac37a72d8e6871586d8 (diff) | |
download | chromium_src-00e3f152083aea092353b3d284c368b48136f33c.zip chromium_src-00e3f152083aea092353b3d284c368b48136f33c.tar.gz chromium_src-00e3f152083aea092353b3d284c368b48136f33c.tar.bz2 |
Convert some structures in webkit/glue to string16.
R=yaar
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/305002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29549 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/webdata/web_database_unittest.cc')
-rw-r--r-- | chrome/browser/webdata/web_database_unittest.cc | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/chrome/browser/webdata/web_database_unittest.cc b/chrome/browser/webdata/web_database_unittest.cc index fcfee84..1d7569b 100644 --- a/chrome/browser/webdata/web_database_unittest.cc +++ b/chrome/browser/webdata/web_database_unittest.cc @@ -264,11 +264,11 @@ TEST_F(WebDatabaseTest, Logins) { PasswordForm form; form.origin = GURL("http://www.google.com/accounts/LoginAuth"); form.action = GURL("http://www.google.com/accounts/Login"); - form.username_element = L"Email"; - form.username_value = L"test@gmail.com"; - form.password_element = L"Passwd"; - form.password_value = L"test"; - form.submit_element = L"signIn"; + form.username_element = ASCIIToUTF16("Email"); + form.username_value = ASCIIToUTF16("test@gmail.com"); + form.password_element = ASCIIToUTF16("Passwd"); + form.password_value = ASCIIToUTF16("test"); + form.submit_element = ASCIIToUTF16("signIn"); form.signon_realm = "http://www.google.com/"; form.ssl_valid = false; form.preferred = false; @@ -290,7 +290,7 @@ TEST_F(WebDatabaseTest, Logins) { // The example site changes... PasswordForm form2(form); form2.origin = GURL("http://www.google.com/new/accounts/LoginAuth"); - form2.submit_element = L"reallySignIn"; + form2.submit_element = ASCIIToUTF16("reallySignIn"); // Match against an inexact copy EXPECT_TRUE(db.GetLogins(form2, &result)); @@ -355,7 +355,7 @@ TEST_F(WebDatabaseTest, Logins) { // User changes his password. PasswordForm form6(form5); - form6.password_value = L"test6"; + form6.password_value = ASCIIToUTF16("test6"); form6.preferred = true; // We update, and check to make sure it matches the @@ -508,14 +508,15 @@ TEST_F(WebDatabaseTest, Autofill) { } static bool AddTimestampedLogin(WebDatabase* db, std::string url, - std::wstring unique_string, const Time& time) { + const std::string& unique_string, + const Time& time) { // Example password form. PasswordForm form; form.origin = GURL(url + std::string("/LoginAuth")); - form.username_element = unique_string.c_str(); - form.username_value = unique_string.c_str(); - form.password_element = unique_string.c_str(); - form.submit_element = L"signIn"; + form.username_element = ASCIIToUTF16(unique_string); + form.username_value = ASCIIToUTF16(unique_string); + form.password_element = ASCIIToUTF16(unique_string); + form.submit_element = ASCIIToUTF16("signIn"); form.signon_realm = url; form.date_created = time; return db->AddLogin(form); @@ -543,11 +544,11 @@ TEST_F(WebDatabaseTest, ClearPrivateData_SavedPasswords) { TimeDelta one_day = TimeDelta::FromDays(1); // Create one with a 0 time. - EXPECT_TRUE(AddTimestampedLogin(&db, "1", L"foo1", Time())); + EXPECT_TRUE(AddTimestampedLogin(&db, "1", "foo1", Time())); // Create one for now and +/- 1 day. - EXPECT_TRUE(AddTimestampedLogin(&db, "2", L"foo2", now - one_day)); - EXPECT_TRUE(AddTimestampedLogin(&db, "3", L"foo3", now)); - EXPECT_TRUE(AddTimestampedLogin(&db, "4", L"foo4", now + one_day)); + EXPECT_TRUE(AddTimestampedLogin(&db, "2", "foo2", now - one_day)); + EXPECT_TRUE(AddTimestampedLogin(&db, "3", "foo3", now)); + EXPECT_TRUE(AddTimestampedLogin(&db, "4", "foo4", now + one_day)); // Verify inserts worked. EXPECT_TRUE(db.GetAllLogins(&result, true)); @@ -584,9 +585,9 @@ TEST_F(WebDatabaseTest, BlacklistedLogins) { PasswordForm form; form.origin = GURL("http://www.google.com/accounts/LoginAuth"); form.action = GURL("http://www.google.com/accounts/Login"); - form.username_element = L"Email"; - form.password_element = L"Passwd"; - form.submit_element = L"signIn"; + form.username_element = ASCIIToUTF16("Email"); + form.password_element = ASCIIToUTF16("Passwd"); + form.submit_element = ASCIIToUTF16("signIn"); form.signon_realm = "http://www.google.com/"; form.ssl_valid = false; form.preferred = true; |