Explicitly set selection ranges in PasswordAutofillAgentTest.

Previously, the selection ranges were set implicitly when setValue() was
called.  After [ https://codereview.chromium.org/258063005/ ], setValue()
will no longer implicitly set a field's selection range, so do so explicitly.

BUG=367736, 133242
TEST=browser_tests

Review URL: https://codereview.chromium.org/373023004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281975 0039d316-1c4b-4281-b951-d872f2087c98
parent 13ae810a
......@@ -1110,6 +1110,7 @@ TEST_F(PasswordAutofillAgentTest, PreviewSuggestion) {
// Tests that |PreviewSuggestion| properly sets the username selection range.
TEST_F(PasswordAutofillAgentTest, PreviewSuggestionSelectionRange) {
username_element_.setValue(WebString::fromUTF8("ali"));
username_element_.setSelectionRange(3, 3);
username_element_.setAutofilled(true);
CheckTextFieldsDOMState("ali", true, std::string(), false);
......@@ -1165,6 +1166,7 @@ TEST_F(PasswordAutofillAgentTest, ClearPreviewWithPasswordAutofilled) {
// with username being previously autofilled.
TEST_F(PasswordAutofillAgentTest, ClearPreviewWithUsernameAutofilled) {
username_element_.setValue(WebString::fromUTF8("ali"));
username_element_.setSelectionRange(3, 3);
username_element_.setAutofilled(true);
// Simulate the browser sending the login info, but set |wait_for_username|
......@@ -1194,6 +1196,7 @@ TEST_F(PasswordAutofillAgentTest, ClearPreviewWithUsernameAutofilled) {
TEST_F(PasswordAutofillAgentTest,
ClearPreviewWithAutofilledUsernameAndPassword) {
username_element_.setValue(WebString::fromUTF8("ali"));
username_element_.setSelectionRange(3, 3);
username_element_.setAutofilled(true);
password_element_.setValue(WebString::fromUTF8("sec"));
password_element_.setAutofilled(true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment