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

Unified Diff: ui/views/view_unittest.cc

Issue 2007503002: Views: Replace resource ids with ui::TextEditCommand enum for text editing commands in Textfield. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added file deleted during rename. Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/view_unittest.cc
diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc
index 89e3c1bb94db3192ab7ad385b757aefc7e79e4f2..359ea3d94ff69f57ea6dcc47d449b53be5649933 100644
--- a/ui/views/view_unittest.cc
+++ b/ui/views/view_unittest.cc
@@ -2029,21 +2029,21 @@ TEST_F(ViewTest, TextfieldCutCopyPaste) {
//
normal->SelectAll(false);
- normal->ExecuteCommand(IDS_APP_CUT);
+ normal->ExecuteCommand(IDS_APP_CUT, 0);
base::string16 result;
clipboard->ReadText(ui::CLIPBOARD_TYPE_COPY_PASTE, &result);
EXPECT_EQ(kNormalText, result);
normal->SetText(kNormalText); // Let's revert to the original content.
read_only->SelectAll(false);
- read_only->ExecuteCommand(IDS_APP_CUT);
+ read_only->ExecuteCommand(IDS_APP_CUT, 0);
result.clear();
clipboard->ReadText(ui::CLIPBOARD_TYPE_COPY_PASTE, &result);
// Cut should have failed, so the clipboard content should not have changed.
EXPECT_EQ(kNormalText, result);
password->SelectAll(false);
- password->ExecuteCommand(IDS_APP_CUT);
+ password->ExecuteCommand(IDS_APP_CUT, 0);
result.clear();
clipboard->ReadText(ui::CLIPBOARD_TYPE_COPY_PASTE, &result);
// Cut should have failed, so the clipboard content should not have changed.
@@ -2055,19 +2055,19 @@ TEST_F(ViewTest, TextfieldCutCopyPaste) {
// Start with |read_only| to observe a change in clipboard text.
read_only->SelectAll(false);
- read_only->ExecuteCommand(IDS_APP_COPY);
+ read_only->ExecuteCommand(IDS_APP_COPY, 0);
result.clear();
clipboard->ReadText(ui::CLIPBOARD_TYPE_COPY_PASTE, &result);
EXPECT_EQ(kReadOnlyText, result);
normal->SelectAll(false);
- normal->ExecuteCommand(IDS_APP_COPY);
+ normal->ExecuteCommand(IDS_APP_COPY, 0);
result.clear();
clipboard->ReadText(ui::CLIPBOARD_TYPE_COPY_PASTE, &result);
EXPECT_EQ(kNormalText, result);
password->SelectAll(false);
- password->ExecuteCommand(IDS_APP_COPY);
+ password->ExecuteCommand(IDS_APP_COPY, 0);
result.clear();
clipboard->ReadText(ui::CLIPBOARD_TYPE_COPY_PASTE, &result);
// Text cannot be copied from an obscured field; the clipboard won't change.
@@ -2079,18 +2079,18 @@ TEST_F(ViewTest, TextfieldCutCopyPaste) {
// Attempting to paste kNormalText in a read-only text-field should fail.
read_only->SelectAll(false);
- read_only->ExecuteCommand(IDS_APP_PASTE);
+ read_only->ExecuteCommand(IDS_APP_PASTE, 0);
EXPECT_EQ(kReadOnlyText, read_only->text());
password->SelectAll(false);
- password->ExecuteCommand(IDS_APP_PASTE);
+ password->ExecuteCommand(IDS_APP_PASTE, 0);
EXPECT_EQ(kNormalText, password->text());
// Copy from |read_only| to observe a change in the normal textfield text.
read_only->SelectAll(false);
- read_only->ExecuteCommand(IDS_APP_COPY);
+ read_only->ExecuteCommand(IDS_APP_COPY, 0);
normal->SelectAll(false);
- normal->ExecuteCommand(IDS_APP_PASTE);
+ normal->ExecuteCommand(IDS_APP_PASTE, 0);
EXPECT_EQ(kReadOnlyText, normal->text());
widget->CloseNow();
}
« ui/views/controls/textfield/textfield.cc ('K') | « ui/views/controls/textfield/textfield.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698