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

Unified Diff: ui/views/controls/textfield/native_textfield_views_unittest.cc

Issue 8748001: Make text input type and password visibility bit independent in Textfield (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/textfield/native_textfield_views_unittest.cc
diff --git a/ui/views/controls/textfield/native_textfield_views_unittest.cc b/ui/views/controls/textfield/native_textfield_views_unittest.cc
index ad051775798383d11e767f2ff78de24ac31c8b36..e915d4691c9c4e61571ef84d7bc42adfc3ae0d46 100644
--- a/ui/views/controls/textfield/native_textfield_views_unittest.cc
+++ b/ui/views/controls/textfield/native_textfield_views_unittest.cc
@@ -517,23 +517,12 @@ TEST_F(NativeTextfieldViewsTest, InputTypeSetsPassword) {
// Defaults to TEXT
EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, GetTextInputType());
- // Setting to passwords also sets password state of textfield.
+ // Setting text input type also sets password state of textfield.
textfield_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD);
EXPECT_EQ(ui::TEXT_INPUT_TYPE_PASSWORD, GetTextInputType());
EXPECT_TRUE(textfield_->IsPassword());
-}
-
-TEST_F(NativeTextfieldViewsTest, PasswordSetsInputType) {
- InitTextfield(Textfield::STYLE_DEFAULT);
-
- // Defaults to TEXT
- EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, GetTextInputType());
-
- textfield_->SetPassword(true);
- EXPECT_EQ(ui::TEXT_INPUT_TYPE_PASSWORD, GetTextInputType());
-
- textfield_->SetPassword(false);
- EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, GetTextInputType());
+ textfield_->SetTextInputType(ui::TEXT_INPUT_TYPE_URL);
+ EXPECT_FALSE(textfield_->IsPassword());
}
TEST_F(NativeTextfieldViewsTest, TextInputType) {
@@ -1111,7 +1100,7 @@ TEST_F(NativeTextfieldViewsTest, TextInputClientTest) {
textfield_->SetReadOnly(false);
input_method_->Clear();
- textfield_->SetPassword(true);
+ textfield_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD);
EXPECT_TRUE(input_method_->text_input_type_changed());
EXPECT_TRUE(textfield_->GetTextInputClient());
}

Powered by Google App Engine
This is Rietveld 408576698