OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <cstring> | 5 #include <cstring> |
6 #include <string> | 6 #include <string> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 } | 837 } |
838 | 838 |
839 // Waits until the class |oauth-enroll-state-success| becomes set for the | 839 // Waits until the class |oauth-enroll-state-success| becomes set for the |
840 // enrollment screen, indicating enrollment success. | 840 // enrollment screen, indicating enrollment success. |
841 void SAMLEnrollmentTest::WaitForEnrollmentSuccess() { | 841 void SAMLEnrollmentTest::WaitForEnrollmentSuccess() { |
842 bool done = false; | 842 bool done = false; |
843 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | 843 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
844 GetLoginUI()->GetWebContents(), | 844 GetLoginUI()->GetWebContents(), |
845 "var enrollmentScreen = document.getElementById('oauth-enrollment');" | 845 "var enrollmentScreen = document.getElementById('oauth-enrollment');" |
846 "function SendReplyIfEnrollmentDone() {" | 846 "function SendReplyIfEnrollmentDone() {" |
| 847 " if (enrollmentScreen.classList.contains(" |
| 848 " 'oauth-enroll-state-attribute-prompt')) {" |
| 849 " $('oauth-enroll-attribute-prompt-card').fire('submit');" |
| 850 " return false;" |
| 851 " }" |
847 " if (!enrollmentScreen.classList.contains(" | 852 " if (!enrollmentScreen.classList.contains(" |
848 " 'oauth-enroll-state-success')) {" | 853 " 'oauth-enroll-state-success')) {" |
849 " return false;" | 854 " return false;" |
850 " }" | 855 " }" |
851 " domAutomationController.send(true);" | 856 " domAutomationController.send(true);" |
852 " observer.disconnect();" | 857 " observer.disconnect();" |
853 " return true;" | 858 " return true;" |
854 "}" | 859 "}" |
855 "var observer = new MutationObserver(SendReplyIfEnrollmentDone);" | 860 "var observer = new MutationObserver(SendReplyIfEnrollmentDone);" |
856 "if (!SendReplyIfEnrollmentDone()) {" | 861 "if (!SendReplyIfEnrollmentDone()) {" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 kTestAuthLSIDCookie1); | 1241 kTestAuthLSIDCookie1); |
1237 | 1242 |
1238 GetCookies(); | 1243 GetCookies(); |
1239 EXPECT_EQ(kTestAuthSIDCookie1, GetCookieValue(kGAIASIDCookieName)); | 1244 EXPECT_EQ(kTestAuthSIDCookie1, GetCookieValue(kGAIASIDCookieName)); |
1240 EXPECT_EQ(kTestAuthLSIDCookie1, GetCookieValue(kGAIALSIDCookieName)); | 1245 EXPECT_EQ(kTestAuthLSIDCookie1, GetCookieValue(kGAIALSIDCookieName)); |
1241 EXPECT_EQ(kSAMLIdPCookieValue1, GetCookieValue(kSAMLIdPCookieName)); | 1246 EXPECT_EQ(kSAMLIdPCookieValue1, GetCookieValue(kSAMLIdPCookieName)); |
1242 } | 1247 } |
1243 | 1248 |
1244 | 1249 |
1245 } // namespace chromeos | 1250 } // namespace chromeos |
OLD | NEW |