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

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

Issue 1123783002: Add ExecuteJavaScriptForTest and make all tests use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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
Index: chrome/renderer/autofill/form_autocomplete_browsertest.cc
diff --git a/chrome/renderer/autofill/form_autocomplete_browsertest.cc b/chrome/renderer/autofill/form_autocomplete_browsertest.cc
index 1a88f8d572060f43ec9c727862d10ac0640ac148..52a3db553eb74e3d681b8608fb1acfe027b536e0 100644
--- a/chrome/renderer/autofill/form_autocomplete_browsertest.cc
+++ b/chrome/renderer/autofill/form_autocomplete_browsertest.cc
@@ -74,7 +74,7 @@ TEST_F(FormAutocompleteTest, NormalFormSubmit) {
"<input name='lname' value='Deckard'/></form></html>");
// Submit the form.
- ExecuteJavaScript("document.getElementById('myForm').submit();");
+ ExecuteJavaScriptForTests("document.getElementById('myForm').submit();");
ProcessPendingMessages();
VerifyReceivedRendererMessages(render_thread_.get(),
@@ -91,7 +91,7 @@ TEST_F(FormAutocompleteTest, SubmitEventPrevented) {
"</html>");
// Submit the form.
- ExecuteJavaScript(
+ ExecuteJavaScriptForTests(
"var form = document.forms[0];"
"form.onsubmit = function(event) { event.preventDefault(); };"
"document.querySelector('input[type=submit]').click();");
@@ -111,7 +111,7 @@ TEST_F(FormAutocompleteTest, AutoCompleteOffFormSubmit) {
"</form></html>");
// Submit the form.
- ExecuteJavaScript("document.getElementById('myForm').submit();");
+ ExecuteJavaScriptForTests("document.getElementById('myForm').submit();");
ProcessPendingMessages();
VerifyReceivedRendererMessages(render_thread_.get(),
@@ -127,7 +127,7 @@ TEST_F(FormAutocompleteTest, AutoCompleteOffInputSubmit) {
"</form></html>");
// Submit the form.
- ExecuteJavaScript("document.getElementById('myForm').submit();");
+ ExecuteJavaScriptForTests("document.getElementById('myForm').submit();");
ProcessPendingMessages();
VerifyReceivedRendererMessages(render_thread_.get(),
@@ -148,13 +148,14 @@ TEST_F(FormAutocompleteTest, DynamicAutoCompleteOffFormSubmit) {
EXPECT_TRUE(form.autoComplete());
// Dynamically mark the form as autocomplete off.
- ExecuteJavaScript("document.getElementById('myForm')."
- "setAttribute('autocomplete', 'off');");
+ ExecuteJavaScriptForTests(
+ "document.getElementById('myForm')."
+ "setAttribute('autocomplete', 'off');");
ProcessPendingMessages();
EXPECT_FALSE(form.autoComplete());
// Submit the form.
- ExecuteJavaScript("document.getElementById('myForm').submit();");
+ ExecuteJavaScriptForTests("document.getElementById('myForm').submit();");
ProcessPendingMessages();
VerifyReceivedRendererMessages(render_thread_.get(),
« no previous file with comments | « chrome/renderer/autofill/autofill_renderer_browsertest.cc ('k') | chrome/renderer/autofill/form_autofill_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698