| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/macros.h" | 5 #include "base/macros.h" |
| 6 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h" | 6 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h" |
| 7 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper.
h" | 7 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper.
h" |
| 8 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_
impl.h" | 8 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_
impl.h" |
| 9 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_
mock.h" | 9 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_
mock.h" |
| 10 #include "chrome/browser/chromeos/login/login_manager_test.h" | 10 #include "chrome/browser/chromeos/login/login_manager_test.h" |
| 11 #include "chrome/browser/chromeos/login/startup_utils.h" | 11 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 12 #include "chrome/browser/chromeos/login/test/js_checker.h" | 12 #include "chrome/browser/chromeos/login/test/js_checker.h" |
| 13 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" | 13 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" |
| 14 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 14 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 15 #include "chrome/browser/chromeos/login/wizard_controller.h" | 15 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 16 #include "chrome/browser/chromeos/policy/enrollment_status_chromeos.h" | 16 #include "chrome/browser/chromeos/policy/enrollment_status_chromeos.h" |
| 17 #include "content/public/test/test_utils.h" | 17 #include "content/public/test/test_utils.h" |
| 18 | 18 |
| 19 using testing::_; | 19 using testing::_; |
| 20 using testing::Invoke; | 20 using testing::Invoke; |
| 21 using testing::InvokeWithoutArgs; | 21 using testing::InvokeWithoutArgs; |
| 22 | 22 |
| 23 namespace chromeos { | 23 namespace chromeos { |
| 24 | 24 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 bool IsStepDisplayed(const std::string& step) { | 131 bool IsStepDisplayed(const std::string& step) { |
| 132 const std::string js = | 132 const std::string js = |
| 133 "document.getElementsByClassName('oauth-enroll-state-" + step + | 133 "document.getElementsByClassName('oauth-enroll-state-" + step + |
| 134 "').length"; | 134 "').length"; |
| 135 int count = js_checker().GetInt(js); | 135 int count = js_checker().GetInt(js); |
| 136 return count > 0; | 136 return count > 0; |
| 137 } | 137 } |
| 138 | 138 |
| 139 // Setup the enrollment screen. | 139 // Setup the enrollment screen. |
| 140 void ShowEnrollmentScreen() { | 140 void ShowEnrollmentScreen() { |
| 141 LoginDisplayHost* host = LoginDisplayHostImpl::default_host(); | 141 LoginDisplayHost* host = LoginDisplayHost::default_host(); |
| 142 ASSERT_TRUE(host != nullptr); | 142 ASSERT_TRUE(host != nullptr); |
| 143 host->StartWizard(WizardController::kEnrollmentScreenName); | 143 host->StartWizard(WizardController::kEnrollmentScreenName); |
| 144 OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_ENROLLMENT).Wait(); | 144 OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_ENROLLMENT).Wait(); |
| 145 ASSERT_TRUE(enrollment_screen() != nullptr); | 145 ASSERT_TRUE(enrollment_screen() != nullptr); |
| 146 ASSERT_TRUE(WizardController::default_controller() != nullptr); | 146 ASSERT_TRUE(WizardController::default_controller() != nullptr); |
| 147 ASSERT_FALSE(StartupUtils::IsOobeCompleted()); | 147 ASSERT_FALSE(StartupUtils::IsOobeCompleted()); |
| 148 } | 148 } |
| 149 | 149 |
| 150 // Helper method to return the current EnrollmentScreen instance. | 150 // Helper method to return the current EnrollmentScreen instance. |
| 151 EnrollmentScreen* enrollment_screen() { | 151 EnrollmentScreen* enrollment_screen() { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 EXPECT_FALSE(IsStepDisplayed("success")); | 222 EXPECT_FALSE(IsStepDisplayed("success")); |
| 223 EXPECT_FALSE(IsStepDisplayed("error")); | 223 EXPECT_FALSE(IsStepDisplayed("error")); |
| 224 | 224 |
| 225 SubmitAttributePromptUpdate(); | 225 SubmitAttributePromptUpdate(); |
| 226 | 226 |
| 227 // We have to remove the enrollment_helper before the dtor gets called. | 227 // We have to remove the enrollment_helper before the dtor gets called. |
| 228 enrollment_screen()->enrollment_helper_.reset(); | 228 enrollment_screen()->enrollment_helper_.reset(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace chromeos | 231 } // namespace chromeos |
| OLD | NEW |