Index: chrome/renderer/autofill/form_autofill_browsertest.cc |
diff --git a/chrome/renderer/autofill/form_autofill_browsertest.cc b/chrome/renderer/autofill/form_autofill_browsertest.cc |
index 4fa945fe8764c36a5e4e591f328a1baa5518a196..7581c360a5a7780885312f1a501449fb3ceea947 100644 |
--- a/chrome/renderer/autofill/form_autofill_browsertest.cc |
+++ b/chrome/renderer/autofill/form_autofill_browsertest.cc |
@@ -232,9 +232,8 @@ class FormAutofillTest : public ChromeRenderViewTest { |
WebString value; |
WebFormControlElement element = GetMainFrame()->document().getElementById( |
ASCIIToUTF16(field_case.name)).to<WebFormControlElement>(); |
- if (element.formControlType() == "select-one") { |
- value = element.to<WebSelectElement>().value(); |
- } else if (element.formControlType() == "textarea") { |
+ if ((element.formControlType() == "select-one") || |
+ (element.formControlType() == "textarea")) { |
value = get_value_function(element); |
} else { |
ASSERT_TRUE(element.formControlType() == "text" || |
@@ -266,6 +265,9 @@ class FormAutofillTest : public ChromeRenderViewTest { |
if (element.formControlType() == "textarea") |
return element.to<WebTextAreaElement>().value(); |
+ if (element.formControlType() == "select-one") |
+ return element.to<WebSelectElement>().value(); |
+ |
return element.to<WebInputElement>().value(); |
} |
@@ -273,6 +275,9 @@ class FormAutofillTest : public ChromeRenderViewTest { |
if (element.formControlType() == "textarea") |
return element.to<WebTextAreaElement>().suggestedValue(); |
+ if (element.formControlType() == "select-one") |
+ return element.to<WebSelectElement>().suggestedValue(); |
+ |
return element.to<WebInputElement>().suggestedValue(); |
} |
@@ -1313,10 +1318,11 @@ TEST_F(FormAutofillTest, PreviewForm) { |
{"month", "month", "", "", true, "2017-11", "2017-11"}, |
// Non-empty <input type="month"> should not be previewed. |
{"month", "month-nonempty", "2011-12", "", false, "2017-11", ""}, |
- // Regular select fields preview is not yet supported |
- {"select-one", "select", "", "", false, "TX", ""}, |
- // Select fields preview is not yet supported |
- {"select-one", "select-nonempty", "CA", "", false, "TX", "CA"}, |
+ // Regular select fields should be previewed. |
+ {"select-one", "select", "", "", true, "TX", "TX"}, |
+ // Select fields should be previewed even if they already have a |
+ // non-empty value. |
+ {"select-one", "select-nonempty", "CA", "", true, "TX", "TX"}, |
// Normal textarea elements should be previewed. |
{"textarea", "textarea", "", "", true, "suggested multi-\nline value", |
"suggested multi-\nline value"}, |