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 f1e2b6212832204039c01a6c5df955b3285ff8ee..0c6ec20fd7bbcec325bd0dbd3b98e9d991ed128c 100644 |
--- a/chrome/browser/autofill/autofill_interactive_uitest.cc |
+++ b/chrome/browser/autofill/autofill_interactive_uitest.cc |
@@ -63,7 +63,7 @@ static const char* kTestFormString = |
"<form action=\"http://www.example.com/\" method=\"POST\">" |
"<label for=\"firstname\">First name:</label>" |
" <input type=\"text\" id=\"firstname\"" |
- " onFocus=\"domAutomationController.send(true)\"><br>" |
+ " onfocus=\"domAutomationController.send(true)\"><br>" |
"<label for=\"lastname\">Last name:</label>" |
" <input type=\"text\" id=\"lastname\"><br>" |
"<label for=\"address1\">Address line 1:</label>" |
@@ -490,9 +490,7 @@ IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, AutofillSelectViaTab) { |
} |
// Test that a JavaScript onchange event is fired after auto-filling a form. |
-// Temporarily disabled for crbug.com/353691. |
-IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, |
- DISABLED_OnChangeAfterAutofill) { |
+IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, OnChangeAfterAutofill) { |
Ilya Sherman
2014/03/29 00:07:07
Could you also add a test for oninput?
Dan Beam
2014/03/29 00:51:14
Done.
|
CreateTestProfile(); |
const char* kOnChangeScript = |
Ilya Sherman
2014/03/29 00:07:07
nit: While you're here... can you update this to b
Dan Beam
2014/03/29 00:51:14
Done.
|
@@ -537,9 +535,6 @@ IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, |
// The form should be filled. |
ExpectFilledTestForm(); |
- // The change event should have already fired for unfocused fields, both of |
- // <input> and of <select> type. However, it should not yet have fired for the |
- // focused field. |
bool focused_fired = false; |
bool unfocused_fired = false; |
bool changed_select_fired = false; |
@@ -560,7 +555,7 @@ IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, |
GetRenderViewHost(), |
"domAutomationController.send(unchanged_select_fired);", |
&unchanged_select_fired)); |
- EXPECT_FALSE(focused_fired); |
+ EXPECT_TRUE(focused_fired); |
EXPECT_TRUE(unfocused_fired); |
EXPECT_TRUE(changed_select_fired); |
EXPECT_FALSE(unchanged_select_fired); |
@@ -609,7 +604,7 @@ IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, AutofillFormWithRepeatedField) { |
"<form action=\"http://www.example.com/\" method=\"POST\">" |
"<label for=\"firstname\">First name:</label>" |
" <input type=\"text\" id=\"firstname\"" |
- " onFocus=\"domAutomationController.send(true)\"><br>" |
+ " onfocus=\"domAutomationController.send(true)\"><br>" |
"<label for=\"lastname\">Last name:</label>" |
" <input type=\"text\" id=\"lastname\"><br>" |
"<label for=\"address1\">Address line 1:</label>" |
@@ -655,7 +650,7 @@ IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, |
"<form action=\"http://www.example.com/\" method=\"POST\">" |
"<label for=\"firstname\">First name:</label>" |
" <input type=\"text\" id=\"firstname\"" |
- " onFocus=\"domAutomationController.send(true)\"><br>" |
+ " onfocus=\"domAutomationController.send(true)\"><br>" |
"<label for=\"middlename\">Middle name:</label>" |
" <input type=\"text\" id=\"middlename\" autocomplete=\"off\" /><br>" |
"<label for=\"lastname\">Last name:</label>" |
@@ -735,10 +730,11 @@ IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, DynamicFormFill) { |
" input_element.setAttribute('id', name);" |
" input_element.setAttribute('name', name);" |
"" |
- " /* Add the onFocus listener to the 'firstname' field. */" |
+ " /* Add the onfocus listener to the 'firstname' field. */" |
" if (name === 'firstname') {" |
- " input_element.setAttribute(" |
- " 'onFocus', 'domAutomationController.send(true)');" |
+ " input_element.onfocus = function() {" |
+ " domAutomationController.send(true);" |
+ " };" |
" }" |
"" |
" form.appendChild(input_element);" |
@@ -799,7 +795,7 @@ IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, AutofillAfterTranslate) { |
"<form action=\"http://www.example.com/\" method=\"POST\">" |
"<label for=\"fn\">なまえ</label>" |
" <input type=\"text\" id=\"fn\"" |
- " onFocus=\"domAutomationController.send(true)\"" |
+ " onfocus=\"domAutomationController.send(true)\"" |
"><br>" |
"<label for=\"ln\">みょうじ</label>" |
" <input type=\"text\" id=\"ln\"><br>" |