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

Unified Diff: chrome/renderer/autofill/password_autofill_agent_browsertest.cc

Issue 373023004: Explicitly set selection ranges in PasswordAutofillAgentTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing changes as per comments Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/autofill/password_autofill_agent_browsertest.cc
diff --git a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
index 180b5d572042ecda872b2a2e601151bce17d20fe..77d853ef096a85d58a19e7bd5182b4b35f235787 100644
--- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
+++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
@@ -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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698