OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h" | 9 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h" |
10 #include "chrome/browser/chromeos/login/enrollment/mock_enrollment_screen.h" | 10 #include "chrome/browser/chromeos/login/enrollment/mock_enrollment_screen.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 WizardController::default_controller(); | 129 WizardController::default_controller(); |
130 } | 130 } |
131 | 131 |
132 IN_PROC_BROWSER_TEST_F(EnrollmentScreenTest, EnrollmentSpinner) { | 132 IN_PROC_BROWSER_TEST_F(EnrollmentScreenTest, EnrollmentSpinner) { |
133 WizardController* wcontroller = WizardController::default_controller(); | 133 WizardController* wcontroller = WizardController::default_controller(); |
134 ASSERT_TRUE(wcontroller); | 134 ASSERT_TRUE(wcontroller); |
135 | 135 |
136 EnrollmentScreen* enrollment_screen = EnrollmentScreen::Get(wcontroller); | 136 EnrollmentScreen* enrollment_screen = EnrollmentScreen::Get(wcontroller); |
137 ASSERT_TRUE(enrollment_screen); | 137 ASSERT_TRUE(enrollment_screen); |
138 | 138 |
139 EnrollmentScreenActor* actor = enrollment_screen->GetActor(); | 139 EnrollmentScreenView* view = enrollment_screen->GetView(); |
140 ASSERT_TRUE(actor); | 140 ASSERT_TRUE(view); |
141 | 141 |
142 test::JSChecker checker( | 142 test::JSChecker checker( |
143 LoginDisplayHost::default_host()->GetWebUILoginView()->GetWebContents()); | 143 LoginDisplayHost::default_host()->GetWebUILoginView()->GetWebContents()); |
144 | 144 |
145 // Run through the flow | 145 // Run through the flow |
146 actor->Show(); | 146 view->Show(); |
147 OobeScreenWaiter(OobeScreen::SCREEN_OOBE_ENROLLMENT).Wait(); | 147 OobeScreenWaiter(OobeScreen::SCREEN_OOBE_ENROLLMENT).Wait(); |
148 checker.ExpectTrue( | 148 checker.ExpectTrue( |
149 "window.getComputedStyle(document.getElementById('oauth-enroll-step-" | 149 "window.getComputedStyle(document.getElementById('oauth-enroll-step-" |
150 "signin')).display !== 'none'"); | 150 "signin')).display !== 'none'"); |
151 | 151 |
152 actor->ShowEnrollmentSpinnerScreen(); | 152 view->ShowEnrollmentSpinnerScreen(); |
153 checker.ExpectTrue( | 153 checker.ExpectTrue( |
154 "window.getComputedStyle(document.getElementById('oauth-enroll-step-" | 154 "window.getComputedStyle(document.getElementById('oauth-enroll-step-" |
155 "working')).display !== 'none'"); | 155 "working')).display !== 'none'"); |
156 | 156 |
157 actor->ShowAttestationBasedEnrollmentSuccessScreen("fake domain"); | 157 view->ShowAttestationBasedEnrollmentSuccessScreen("fake domain"); |
158 checker.ExpectTrue( | 158 checker.ExpectTrue( |
159 "window.getComputedStyle(document.getElementById('oauth-enroll-step-abe-" | 159 "window.getComputedStyle(document.getElementById('oauth-enroll-step-abe-" |
160 "success')).display !== 'none'"); | 160 "success')).display !== 'none'"); |
161 } | 161 } |
162 | 162 |
163 class ForcedAttestationAuthEnrollmentScreenTest : public EnrollmentScreenTest { | 163 class ForcedAttestationAuthEnrollmentScreenTest : public EnrollmentScreenTest { |
164 public: | 164 public: |
165 ForcedAttestationAuthEnrollmentScreenTest() {} | 165 ForcedAttestationAuthEnrollmentScreenTest() {} |
166 | 166 |
167 private: | 167 private: |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); | 286 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); |
287 enrollment_screen->OnCancel(); | 287 enrollment_screen->OnCancel(); |
288 content::RunThisRunLoop(&run_loop); | 288 content::RunThisRunLoop(&run_loop); |
289 Mock::VerifyAndClearExpectations(&mock_base_screen_delegate); | 289 Mock::VerifyAndClearExpectations(&mock_base_screen_delegate); |
290 | 290 |
291 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ = | 291 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ = |
292 WizardController::default_controller(); | 292 WizardController::default_controller(); |
293 } | 293 } |
294 | 294 |
295 } // namespace chromeos | 295 } // namespace chromeos |
OLD | NEW |