Index: chrome/browser/autofill/autofill_interactive_uitest.cc |
diff --git a/chrome/browser/autofill/autofill_interactive_uitest.cc b/chrome/browser/autofill/autofill_interactive_uitest.cc |
index 259e568ea3f061cb2c5c57c5de4d5c65770222a9..31ae763e3de5749384053d6f0a3f4efafa58785a 100644 |
--- a/chrome/browser/autofill/autofill_interactive_uitest.cc |
+++ b/chrome/browser/autofill/autofill_interactive_uitest.cc |
@@ -483,6 +483,35 @@ IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, AutofillSelectViaTab) { |
ExpectFilledTestForm(); |
} |
+// Test that a field is still autofillable after the previously autofilled |
+// value is deleted. |
+IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, OnDeleteValueAfterAutofill) { |
+ CreateTestProfile(); |
+ |
+ // Load the test page. |
+ ASSERT_NO_FATAL_FAILURE(ui_test_utils::NavigateToURL(browser(), |
+ GURL(std::string(kDataURIPrefix) + kTestFormString))); |
+ |
+ // Invoke and accept the Autofill popup and verify the form was filled. |
+ FocusFirstNameField(); |
+ SendKeyToPageAndWait(ui::VKEY_M); |
+ SendKeyToPopupAndWait(ui::VKEY_DOWN); |
+ SendKeyToPopupAndWait(ui::VKEY_RETURN); |
+ ExpectFilledTestForm(); |
+ |
+ // Delete the value of a filled field. |
+ ASSERT_TRUE(content::ExecuteScript( |
+ GetRenderViewHost(), |
+ "document.getElementById('firstname').value = '';")); |
+ ExpectFieldValue("firstname", ""); |
+ |
+ // Invoke and accept the Autofill popup and verify the field was filled. |
+ SendKeyToPageAndWait(ui::VKEY_M); |
+ SendKeyToPopupAndWait(ui::VKEY_DOWN); |
+ SendKeyToPopupAndWait(ui::VKEY_RETURN); |
+ ExpectFieldValue("firstname", "Milton"); |
+} |
+ |
// Test that a JavaScript oninput event is fired after auto-filling a form. |
IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, OnInputAfterAutofill) { |
CreateTestProfile(); |