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

Side by Side Diff: components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc

Issue 112433004: Update uses of UTF conversions in chrome_frame/, chromeos/, components/ to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/strings/string16.h" 5 #include "base/strings/string16.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "components/autofill/content/renderer/password_form_conversion_utils.h" 7 #include "components/autofill/content/renderer/password_form_conversion_utils.h"
8 #include "components/autofill/core/common/password_form.h" 8 #include "components/autofill/core/common/password_form.h"
9 #include "content/public/test/render_view_test.h" 9 #include "content/public/test/render_view_test.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 frame->document().forms(forms); 48 frame->document().forms(forms);
49 ASSERT_EQ(1U, forms.size()); 49 ASSERT_EQ(1U, forms.size());
50 WebPasswordFormData web_password_form(forms[0]); 50 WebPasswordFormData web_password_form(forms[0]);
51 ASSERT_TRUE(web_password_form.isValid()); 51 ASSERT_TRUE(web_password_form.isValid());
52 52
53 scoped_ptr<PasswordForm> password_form = CreatePasswordForm(forms[0]); 53 scoped_ptr<PasswordForm> password_form = CreatePasswordForm(forms[0]);
54 ASSERT_NE(static_cast<PasswordForm*>(NULL), password_form.get()); 54 ASSERT_NE(static_cast<PasswordForm*>(NULL), password_form.get());
55 55
56 EXPECT_EQ("data:", password_form->signon_realm); 56 EXPECT_EQ("data:", password_form->signon_realm);
57 EXPECT_EQ(GURL("http://cnn.com"), password_form->action); 57 EXPECT_EQ(GURL("http://cnn.com"), password_form->action);
58 EXPECT_EQ(UTF8ToUTF16("username"), password_form->username_element); 58 EXPECT_EQ(base::UTF8ToUTF16("username"), password_form->username_element);
59 EXPECT_EQ(UTF8ToUTF16("johnsmith"), password_form->username_value); 59 EXPECT_EQ(base::UTF8ToUTF16("johnsmith"), password_form->username_value);
60 EXPECT_EQ(UTF8ToUTF16("password"), password_form->password_element); 60 EXPECT_EQ(base::UTF8ToUTF16("password"), password_form->password_element);
61 EXPECT_EQ(UTF8ToUTF16("secret"), password_form->password_value); 61 EXPECT_EQ(base::UTF8ToUTF16("secret"), password_form->password_value);
62 EXPECT_EQ(PasswordForm::SCHEME_HTML, password_form->scheme); 62 EXPECT_EQ(PasswordForm::SCHEME_HTML, password_form->scheme);
63 EXPECT_FALSE(password_form->ssl_valid); 63 EXPECT_FALSE(password_form->ssl_valid);
64 EXPECT_FALSE(password_form->preferred); 64 EXPECT_FALSE(password_form->preferred);
65 EXPECT_FALSE(password_form->blacklisted_by_user); 65 EXPECT_FALSE(password_form->blacklisted_by_user);
66 EXPECT_EQ(PasswordForm::TYPE_MANUAL, password_form->type); 66 EXPECT_EQ(PasswordForm::TYPE_MANUAL, password_form->type);
67 } 67 }
68 68
69 TEST_F(PasswordFormConversionUtilsTest, InvalidWebFormElementToPasswordForm) { 69 TEST_F(PasswordFormConversionUtilsTest, InvalidWebFormElementToPasswordForm) {
70 LoadHTML("<FORM name=\"TestForm\" action=\"invalid\" method=\"post\">" 70 LoadHTML("<FORM name=\"TestForm\" action=\"invalid\" method=\"post\">"
71 " <INPUT type=\"text\" name=\"username\" " 71 " <INPUT type=\"text\" name=\"username\" "
(...skipping 10 matching lines...) Expand all
82 frame->document().forms(forms); 82 frame->document().forms(forms);
83 ASSERT_EQ(1U, forms.size()); 83 ASSERT_EQ(1U, forms.size());
84 WebPasswordFormData web_password_form(forms[0]); 84 WebPasswordFormData web_password_form(forms[0]);
85 ASSERT_FALSE(web_password_form.isValid()); 85 ASSERT_FALSE(web_password_form.isValid());
86 86
87 scoped_ptr<PasswordForm> password_form = CreatePasswordForm(forms[0]); 87 scoped_ptr<PasswordForm> password_form = CreatePasswordForm(forms[0]);
88 EXPECT_EQ(static_cast<PasswordForm*>(NULL), password_form.get()); 88 EXPECT_EQ(static_cast<PasswordForm*>(NULL), password_form.get());
89 } 89 }
90 90
91 } // namespace autofill 91 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/content/renderer/password_autofill_agent.cc ('k') | components/autofill/core/browser/address.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698