Index: ui/views/controls/textfield/textfield_unittest.cc |
diff --git a/ui/views/controls/textfield/textfield_unittest.cc b/ui/views/controls/textfield/textfield_unittest.cc |
index 1c47e635dede5f1422a8655e7149edf52311de9e..94e76892b295b063c846bd20221fa624c0574a7a 100644 |
--- a/ui/views/controls/textfield/textfield_unittest.cc |
+++ b/ui/views/controls/textfield/textfield_unittest.cc |
@@ -1334,11 +1334,20 @@ TEST_F(TextfieldTest, TextInputClientTest) { |
EXPECT_EQ(0, on_after_user_action_); |
input_method_->Clear(); |
+ |
+ // Changing the Textfield to readonly shouldn't change the input client, since |
+ // it's still required for selections and clipboard copy. |
+ ui::TextInputClient* text_input_client = textfield_->GetTextInputClient(); |
+ EXPECT_TRUE(text_input_client); |
+ EXPECT_NE(ui::TEXT_INPUT_TYPE_NONE, text_input_client->GetTextInputType()); |
textfield_->SetReadOnly(true); |
EXPECT_TRUE(input_method_->text_input_type_changed()); |
- EXPECT_FALSE(textfield_->GetTextInputClient()); |
+ EXPECT_EQ(text_input_client, textfield_->GetTextInputClient()); |
+ EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, text_input_client->GetTextInputType()); |
textfield_->SetReadOnly(false); |
msw
2015/02/11 16:45:00
nit: add EXPECT_TRUE(input_method_->text_input_typ
tapted
2015/02/11 23:29:08
Done.
|
+ EXPECT_NE(ui::TEXT_INPUT_TYPE_NONE, text_input_client->GetTextInputType()); |
+ |
input_method_->Clear(); |
textfield_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD); |
EXPECT_TRUE(input_method_->text_input_type_changed()); |