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 21213d213cf5a7633fb8ec37c93d49fe15783575..61ec36e3a7bdb8524f3b9b2b23eea8e16fc70e19 100644 |
--- a/ui/views/controls/textfield/native_textfield_views_unittest.cc |
+++ b/ui/views/controls/textfield/native_textfield_views_unittest.cc |
@@ -509,6 +509,11 @@ TEST_F(NativeTextfieldViewsTest, PasswordTest) { |
// the actual text instead of "*". |
EXPECT_STR_EQ("my password", textfield_->text()); |
EXPECT_TRUE(last_contents_.empty()); |
+ |
+ // Cut and copy should be disabled in the context menu. |
+ model_->SelectAll(); |
+ EXPECT_FALSE(IsCommandIdEnabled(IDS_APP_CUT)); |
+ EXPECT_FALSE(IsCommandIdEnabled(IDS_APP_COPY)); |
oshima
2011/12/02 23:15:54
can you also add ctrl-c/ctrl-x?
benrg
2011/12/06 17:21:30
Done.
|
} |
TEST_F(NativeTextfieldViewsTest, InputTypeSetsPassword) { |
@@ -822,6 +827,11 @@ TEST_F(NativeTextfieldViewsTest, MAYBE_DragAndDrop_InitiateDrag) { |
EXPECT_EQ(ui::DragDropTypes::DRAG_NONE, |
textfield_view_->GetDragOperationsForView(NULL, kStringPoint)); |
textfield_->SelectRange(kStringRange); |
+ // Ensure that password textfields do not support drag operations. |
+ textfield_->SetIsPassword(true); |
+ EXPECT_EQ(ui::DragDropTypes::DRAG_NONE, |
+ textfield_view_->GetDragOperationsForView(NULL, kStringPoint)); |
+ textfield_->SetIsPassword(false); |
// Ensure that textfields only initiate drag operations inside the selection. |
EXPECT_EQ(ui::DragDropTypes::DRAG_NONE, |
textfield_view_->GetDragOperationsForView(NULL, gfx::Point())); |