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 441577177c2be5ab11ff410fd43cf56342293c37..39d75b551f25e3ce3f67a610dde2b59b013ce35a 100644 |
--- a/chrome/renderer/autofill/password_generation_agent_browsertest.cc |
+++ b/chrome/renderer/autofill/password_generation_agent_browsertest.cc |
@@ -63,6 +63,7 @@ class PasswordGenerationAgentTest : public ChromeRenderViewTest { |
ExecuteJavaScript( |
base::StringPrintf("document.getElementById('%s').focus();", |
element_id).c_str()); |
+ SimulateFocusChangeCompleteMessageReceived(); |
if (available) { |
ASSERT_EQ(1u, password_generation_->messages().size()); |
EXPECT_EQ(AutofillHostMsg_ShowPasswordGenerationPopup::ID, |
@@ -266,8 +267,8 @@ TEST_F(PasswordGenerationAgentTest, BlacklistedTest) { |
SetAccountCreationFormsDetectedMessage(kAccountCreationFormHTML); |
ExpectPasswordGenerationAvailable("first_password", false); |
- // Receive one not blackliste message for account creation form. Show password |
- // generation icon. |
+ // Receive one not blacklisted message for account creation form. Show |
+ // password generation icon. |
LoadHTML(kAccountCreationFormHTML); |
SetNotBlacklistedMessage(kAccountCreationFormHTML); |
SetAccountCreationFormsDetectedMessage(kAccountCreationFormHTML); |
@@ -283,7 +284,7 @@ TEST_F(PasswordGenerationAgentTest, BlacklistedTest) { |
} |
TEST_F(PasswordGenerationAgentTest, AccountCreationFormsDetectedTest) { |
- // Did not receive account creation forms detected messege. Don't show |
+ // Did not receive account creation forms detected message. Don't show |
// password generation icon. |
LoadHTML(kAccountCreationFormHTML); |
SetNotBlacklistedMessage(kAccountCreationFormHTML); |
@@ -363,12 +364,14 @@ 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();"); |
+ SimulateFocusChangeCompleteMessageReceived(); |
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();"); |
- EXPECT_EQ(1u, password_generation_->messages().size()); |
+ SimulateFocusChangeCompleteMessageReceived(); |
+ ASSERT_EQ(1u, password_generation_->messages().size()); |
EXPECT_EQ(AutofillHostMsg_ShowPasswordGenerationPopup::ID, |
password_generation_->messages()[0]->type()); |
password_generation_->clear_messages(); |
@@ -406,7 +409,7 @@ TEST_F(PasswordGenerationAgentTest, DynamicFormTest) { |
"form.appendChild(second_password);" |
"document.body.appendChild(form);"); |
ProcessPendingMessages(); |
- // TODO(gcasto): I'm slighty worried about flakes in this test where |
+ // TODO(gcasto): I'm slightly worried about flakes in this test where |
// didAssociateFormControls() isn't called. If this turns out to be a problem |
// adding a call to OnDynamicFormsSeen(GetMainFrame()) will fix it, though |
// it will weaken the test. |