Chromium Code Reviews| Index: chrome/browser/chromeos/login/saml/saml_browsertest.cc |
| diff --git a/chrome/browser/chromeos/login/saml/saml_browsertest.cc b/chrome/browser/chromeos/login/saml/saml_browsertest.cc |
| index 8a5e7c3ecd725e8bcf20a9d3dd464b8967b4faff..e77f9343d41837865d765f25ce918b7906ef0ec3 100644 |
| --- a/chrome/browser/chromeos/login/saml/saml_browsertest.cc |
| +++ b/chrome/browser/chromeos/login/saml/saml_browsertest.cc |
| @@ -493,6 +493,16 @@ IN_PROC_BROWSER_TEST_F(SamlTest, ScrapedSingle) { |
| fake_saml_idp()->SetLoginHTMLTemplate("saml_login.html"); |
| StartSamlAndWaitForIdpPageLoad(kFirstSAMLUserEmail); |
| + // Make sure that the password is scraped correctly. |
| + ASSERT_TRUE(content::ExecuteScript( |
| + GetLoginUI()->GetWebContents(), |
| + "$('gaia-signin').gaiaAuthHost_.addEventListener('authCompleted'," |
| + " function(e) {" |
| + " var password = e.detail.password;" |
| + " window.domAutomationController.setAutomationId(0);" |
| + " window.domAutomationController.send(password);" |
| + " });")); |
| + |
| // Fill-in the SAML IdP form and submit. |
| SetSignFormField("Email", "fake_user"); |
| SetSignFormField("Password", "fake_password"); |
| @@ -501,7 +511,14 @@ IN_PROC_BROWSER_TEST_F(SamlTest, ScrapedSingle) { |
| content::WindowedNotificationObserver session_start_waiter( |
| chrome::NOTIFICATION_SESSION_STARTED, |
| content::NotificationService::AllSources()); |
| + content::DOMMessageQueue message_queue; |
| ExecuteJsInSigninFrame("document.getElementById('Submit').click();"); |
| + std::string message; |
| + do { |
| + ASSERT_TRUE(message_queue.WaitForMessage(&message)); |
| + } while (message != "\"fake_password\""); |
| + ASSERT_EQ(message, "\"fake_password\""); |
|
xiyuan
2016/06/08 16:40:23
nit: ASSERT_EQ not necessary since we would not be
afakhry
2016/06/08 16:47:08
Yes I was just being paranoid! :D
Done.
|
| + |
| session_start_waiter.Wait(); |
| } |