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 <memory> | 6 #include <memory> |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 } | 839 } |
840 | 840 |
841 // Waits until the class |oauth-enroll-state-success| becomes set for the | 841 // Waits until the class |oauth-enroll-state-success| becomes set for the |
842 // enrollment screen, indicating enrollment success. | 842 // enrollment screen, indicating enrollment success. |
843 void SAMLEnrollmentTest::WaitForEnrollmentSuccess() { | 843 void SAMLEnrollmentTest::WaitForEnrollmentSuccess() { |
844 bool done = false; | 844 bool done = false; |
845 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | 845 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
846 GetLoginUI()->GetWebContents(), | 846 GetLoginUI()->GetWebContents(), |
847 "var enrollmentScreen = document.getElementById('oauth-enrollment');" | 847 "var enrollmentScreen = document.getElementById('oauth-enrollment');" |
848 "function SendReplyIfEnrollmentDone() {" | 848 "function SendReplyIfEnrollmentDone() {" |
| 849 " if (enrollmentScreen.classList.contains(" |
| 850 " 'oauth-enroll-state-attribute-prompt')) {" |
| 851 " $('oauth-enroll-attribute-prompt-card').fire('submit');" |
| 852 " return false;" |
| 853 " }" |
849 " if (!enrollmentScreen.classList.contains(" | 854 " if (!enrollmentScreen.classList.contains(" |
850 " 'oauth-enroll-state-success')) {" | 855 " 'oauth-enroll-state-success')) {" |
851 " return false;" | 856 " return false;" |
852 " }" | 857 " }" |
853 " domAutomationController.send(true);" | 858 " domAutomationController.send(true);" |
854 " observer.disconnect();" | 859 " observer.disconnect();" |
855 " return true;" | 860 " return true;" |
856 "}" | 861 "}" |
857 "var observer = new MutationObserver(SendReplyIfEnrollmentDone);" | 862 "var observer = new MutationObserver(SendReplyIfEnrollmentDone);" |
858 "if (!SendReplyIfEnrollmentDone()) {" | 863 "if (!SendReplyIfEnrollmentDone()) {" |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1358 chrome::NOTIFICATION_SESSION_STARTED, | 1363 chrome::NOTIFICATION_SESSION_STARTED, |
1359 content::NotificationService::AllSources()); | 1364 content::NotificationService::AllSources()); |
1360 | 1365 |
1361 OobeScreenWaiter(OobeScreen::SCREEN_CONFIRM_PASSWORD).Wait(); | 1366 OobeScreenWaiter(OobeScreen::SCREEN_CONFIRM_PASSWORD).Wait(); |
1362 SendConfirmPassword("fake_password"); | 1367 SendConfirmPassword("fake_password"); |
1363 // Login should finish login and a session should start. | 1368 // Login should finish login and a session should start. |
1364 session_start_waiter.Wait(); | 1369 session_start_waiter.Wait(); |
1365 } | 1370 } |
1366 | 1371 |
1367 } // namespace chromeos | 1372 } // namespace chromeos |
OLD | NEW |