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 96bc8996fd4b07b0de45154702706b259e70c8ff..80b761b49f6374e17745994f060ff974fc23b660 100644 |
--- a/chrome/browser/chromeos/login/saml/saml_browsertest.cc |
+++ b/chrome/browser/chromeos/login/saml/saml_browsertest.cc |
@@ -91,6 +91,8 @@ const char kTestAuthSIDCookie2[] = "fake-auth-SID-cookie-2"; |
const char kTestAuthLSIDCookie1[] = "fake-auth-LSID-cookie-1"; |
const char kTestAuthLSIDCookie2[] = "fake-auth-LSID-cookie-2"; |
+const char kTestGaiaId[] = "12345"; |
+ |
const char kFirstSAMLUserEmail[] = "bob@example.com"; |
const char kSecondSAMLUserEmail[] = "alice@example.com"; |
const char kHTTPSAMLUserEmail[] = "carol@example.com"; |
@@ -296,7 +298,8 @@ class SamlTest : public InProcessBrowserTest { |
} |
virtual void SetUpOnMainThread() override { |
- fake_gaia_.SetFakeMergeSessionParams(kFirstSAMLUserEmail, |
+ fake_gaia_.SetFakeMergeSessionParams(kTestGaiaId, |
+ kFirstSAMLUserEmail, |
kTestAuthSIDCookie1, |
kTestAuthLSIDCookie1); |
@@ -542,7 +545,7 @@ IN_PROC_BROWSER_TEST_F(SamlTest, ScrapedNone) { |
IN_PROC_BROWSER_TEST_F(SamlTest, UseAutenticatedUserEmailAddress) { |
fake_saml_idp()->SetLoginHTMLTemplate("saml_login.html"); |
// Type |bob@example.com| into the GAIA login form. |
- StartSamlAndWaitForIdpPageLoad(kSecondSAMLUserEmail); |
+ StartSamlAndWaitForIdpPageLoad(kFirstSAMLUserEmail); |
// Authenticate as alice@example.com via SAML (the |Email| provided here is |
// irrelevant - the authenticated user's e-mail address that FakeGAIA |
@@ -567,10 +570,11 @@ IN_PROC_BROWSER_TEST_F(SamlTest, UseAutenticatedUserEmailAddress) { |
// an error message is shown. |
IN_PROC_BROWSER_TEST_F(SamlTest, FailToRetrieveAutenticatedUserEmailAddress) { |
fake_saml_idp()->SetLoginHTMLTemplate("saml_login.html"); |
+ fake_gaia_.SetFakeMergeSessionParams( |
bartfab (slow)
2014/10/17 09:54:55
Once FakeGaia has been fixed to return the e-mail
Roger Tawa OOO till Jul 10th
2014/10/20 16:04:00
Done.
|
+ "", "", kTestAuthSIDCookie1, kTestAuthLSIDCookie1); |
+ |
StartSamlAndWaitForIdpPageLoad(kFirstSAMLUserEmail); |
- fake_gaia_.SetFakeMergeSessionParams( |
- "", kTestAuthSIDCookie1, kTestAuthLSIDCookie1); |
SetSignFormField("Email", "fake_user"); |
SetSignFormField("Password", "fake_password"); |
ExecuteJsInSigninFrame("document.getElementById('Submit').click();"); |
@@ -652,7 +656,8 @@ class SAMLPolicyTest : public SamlTest { |
void EnableTransferSAMLCookiesPolicy(); |
void ShowGAIALoginForm(); |
- void LogInWithSAML(const std::string& user_id, |
+ void LogInWithSAML(const std::string& gaia_id, |
+ const std::string& user_id, |
const std::string& auth_sid_cookie, |
const std::string& auth_lsid_cookie); |
@@ -764,14 +769,15 @@ void SAMLPolicyTest::ShowGAIALoginForm() { |
EXPECT_EQ("\"ready\"", message); |
} |
-void SAMLPolicyTest::LogInWithSAML(const std::string& user_id, |
+void SAMLPolicyTest::LogInWithSAML(const std::string& gaia_id, |
+ const std::string& user_id, |
const std::string& auth_sid_cookie, |
const std::string& auth_lsid_cookie) { |
fake_saml_idp()->SetLoginHTMLTemplate("saml_login.html"); |
StartSamlAndWaitForIdpPageLoad(user_id); |
fake_gaia_.SetFakeMergeSessionParams( |
- user_id, auth_sid_cookie, auth_lsid_cookie); |
+ gaia_id, user_id, auth_sid_cookie, auth_lsid_cookie); |
SetSignFormField("Email", "fake_user"); |
SetSignFormField("Password", "fake_password"); |
ExecuteJsInSigninFrame("document.getElementById('Submit').click();"); |
@@ -855,7 +861,8 @@ IN_PROC_BROWSER_TEST_F(SAMLPolicyTest, PRE_SAMLNoLimit) { |
// Remove the offline login time limit for SAML users. |
SetSAMLOfflineSigninTimeLimitPolicy(-1); |
- LogInWithSAML(kFirstSAMLUserEmail, kTestAuthSIDCookie1, kTestAuthLSIDCookie1); |
+ LogInWithSAML(kTestGaiaId, kFirstSAMLUserEmail, kTestAuthSIDCookie1, |
+ kTestAuthLSIDCookie1); |
} |
// Verifies that when no offline login time limit is set, a user who |
@@ -871,7 +878,8 @@ IN_PROC_BROWSER_TEST_F(SAMLPolicyTest, PRE_SAMLZeroLimit) { |
// Set the offline login time limit for SAML users to zero. |
SetSAMLOfflineSigninTimeLimitPolicy(0); |
- LogInWithSAML(kFirstSAMLUserEmail, kTestAuthSIDCookie1, kTestAuthLSIDCookie1); |
+ LogInWithSAML(kTestGaiaId, kFirstSAMLUserEmail, kTestAuthSIDCookie1, |
+ kTestAuthLSIDCookie1); |
} |
// Verifies that when the offline login time limit is exceeded for a user who |
@@ -885,7 +893,8 @@ IN_PROC_BROWSER_TEST_F(SAMLPolicyTest, SAMLZeroLimit) { |
IN_PROC_BROWSER_TEST_F(SAMLPolicyTest, PRE_PRE_TransferCookiesAffiliated) { |
fake_saml_idp()->SetCookieValue(kSAMLIdPCookieValue1); |
- LogInWithSAML(kFirstSAMLUserEmail, kTestAuthSIDCookie1, kTestAuthLSIDCookie1); |
+ LogInWithSAML(kTestGaiaId, kFirstSAMLUserEmail, kTestAuthSIDCookie1, |
+ kTestAuthLSIDCookie1); |
GetCookies(); |
EXPECT_EQ(kTestAuthSIDCookie1, GetCookieValue(kGAIASIDCookieName)); |
@@ -901,7 +910,8 @@ IN_PROC_BROWSER_TEST_F(SAMLPolicyTest, PRE_TransferCookiesAffiliated) { |
fake_saml_idp()->SetCookieValue(kSAMLIdPCookieValue2); |
fake_saml_idp()->SetLoginHTMLTemplate("saml_login.html"); |
ShowGAIALoginForm(); |
- LogInWithSAML(kFirstSAMLUserEmail, kTestAuthSIDCookie2, kTestAuthLSIDCookie2); |
+ LogInWithSAML(kTestGaiaId, kFirstSAMLUserEmail, kTestAuthSIDCookie2, |
+ kTestAuthLSIDCookie2); |
GetCookies(); |
EXPECT_EQ(kTestAuthSIDCookie1, GetCookieValue(kGAIASIDCookieName)); |
@@ -919,7 +929,8 @@ IN_PROC_BROWSER_TEST_F(SAMLPolicyTest, TransferCookiesAffiliated) { |
ShowGAIALoginForm(); |
EnableTransferSAMLCookiesPolicy(); |
- LogInWithSAML(kFirstSAMLUserEmail, kTestAuthSIDCookie2, kTestAuthLSIDCookie2); |
+ LogInWithSAML(kTestGaiaId, kFirstSAMLUserEmail, kTestAuthSIDCookie2, |
+ kTestAuthLSIDCookie2); |
GetCookies(); |
EXPECT_EQ(kTestAuthSIDCookie1, GetCookieValue(kGAIASIDCookieName)); |
@@ -929,7 +940,8 @@ IN_PROC_BROWSER_TEST_F(SAMLPolicyTest, TransferCookiesAffiliated) { |
IN_PROC_BROWSER_TEST_F(SAMLPolicyTest, PRE_TransferCookiesUnaffiliated) { |
fake_saml_idp()->SetCookieValue(kSAMLIdPCookieValue1); |
- LogInWithSAML(kDifferentDomainSAMLUserEmail, |
+ LogInWithSAML(kTestGaiaId, |
+ kDifferentDomainSAMLUserEmail, |
kTestAuthSIDCookie1, |
kTestAuthLSIDCookie1); |
@@ -949,7 +961,8 @@ IN_PROC_BROWSER_TEST_F(SAMLPolicyTest, TransferCookiesUnaffiliated) { |
ShowGAIALoginForm(); |
EnableTransferSAMLCookiesPolicy(); |
- LogInWithSAML(kDifferentDomainSAMLUserEmail, |
+ LogInWithSAML(kTestGaiaId, |
+ kDifferentDomainSAMLUserEmail, |
kTestAuthSIDCookie1, |
kTestAuthLSIDCookie1); |