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

Unified Diff: chrome/browser/chromeos/login/saml/saml_browsertest.cc

Issue 2049103002: Fix SAML single-password scrapping authenticating with an empty password (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit Created 4 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/resources/gaia_auth_host/authenticator.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3977a71dc6f0232c474d6ef918653b1f749b3b51 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,13 @@ 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\"");
+
session_start_waiter.Wait();
}
« no previous file with comments | « no previous file | chrome/browser/resources/gaia_auth_host/authenticator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698