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

Unified Diff: chrome/renderer/autofill/password_generation_agent_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/password_generation_agent_browsertest.cc
diff --git a/chrome/renderer/autofill/password_generation_agent_browsertest.cc b/chrome/renderer/autofill/password_generation_agent_browsertest.cc
index 731d7c072aeea4b8103fe2ae56095273d9f6e953..3fc06a1e87b108a1d2120bc759a471b8e652fc74 100644
--- a/chrome/renderer/autofill/password_generation_agent_browsertest.cc
+++ b/chrome/renderer/autofill/password_generation_agent_browsertest.cc
@@ -51,7 +51,7 @@ class PasswordGenerationAgentTest : public ChromeRenderViewTest {
blink::WebElement element =
document.getElementById(blink::WebString::fromUTF8(element_id));
ASSERT_FALSE(element.isNull());
- ExecuteJavaScript(
+ ExecuteJavaScriptForTests(
base::StringPrintf("document.getElementById('%s').focus();",
element_id).c_str());
}
@@ -418,12 +418,13 @@ TEST_F(PasswordGenerationAgentTest, MaximumOfferSize) {
// Change focus. Bubble should be hidden, but that is handled by AutofilAgent,
// so no messages are sent.
- ExecuteJavaScript("document.getElementById('username').focus();");
+ ExecuteJavaScriptForTests("document.getElementById('username').focus();");
EXPECT_EQ(0u, password_generation_->messages().size());
password_generation_->clear_messages();
// Focusing the password field will bring up the generation UI again.
- ExecuteJavaScript("document.getElementById('first_password').focus();");
+ ExecuteJavaScriptForTests(
+ "document.getElementById('first_password').focus();");
ASSERT_EQ(1u, password_generation_->messages().size());
EXPECT_EQ(AutofillHostMsg_ShowPasswordGenerationPopup::ID,
password_generation_->messages()[0]->type());
@@ -443,7 +444,7 @@ TEST_F(PasswordGenerationAgentTest, DynamicFormTest) {
LoadHTMLWithUserGesture(kSigninFormHTML);
SetNotBlacklistedMessage(password_generation_, kSigninFormHTML);
- ExecuteJavaScript(
+ ExecuteJavaScriptForTests(
"var form = document.createElement('form');"
"var username = document.createElement('input');"
"username.type = 'text';"

Powered by Google App Engine
This is Rietveld 408576698