| Index: chrome/browser/chromeos/login/enrollment/enrollment_screen_browsertest.cc
|
| diff --git a/chrome/browser/chromeos/login/enrollment/enrollment_screen_browsertest.cc b/chrome/browser/chromeos/login/enrollment/enrollment_screen_browsertest.cc
|
| index 33e02491362936a751241f29f24d1c6b0cb4b6c4..861220e6650195757f348ef9137226f135b8db16 100644
|
| --- a/chrome/browser/chromeos/login/enrollment/enrollment_screen_browsertest.cc
|
| +++ b/chrome/browser/chromeos/login/enrollment/enrollment_screen_browsertest.cc
|
| @@ -83,6 +83,95 @@ IN_PROC_BROWSER_TEST_F(EnrollmentScreenTest, DISABLED_TestSuccess) {
|
| WizardController::default_controller();
|
| }
|
|
|
| +class MultiAuthEnrollmentScreenTest : public EnrollmentScreenTest {
|
| + public:
|
| + MultiAuthEnrollmentScreenTest() {}
|
| +
|
| + private:
|
| + // Overridden from InProcessBrowserTest:
|
| + void SetUpCommandLine(base::CommandLine* command_line) override {
|
| + command_line->AppendSwitch(switches::kEnterpriseEnableZeroTouchEnrollment);
|
| + }
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(MultiAuthEnrollmentScreenTest);
|
| +};
|
| +
|
| +IN_PROC_BROWSER_TEST_F(MultiAuthEnrollmentScreenTest, TestCancel) {
|
| + ASSERT_TRUE(WizardController::default_controller() != NULL);
|
| +
|
| + EnrollmentScreen* enrollment_screen =
|
| + EnrollmentScreen::Get(WizardController::default_controller());
|
| + ASSERT_TRUE(enrollment_screen != NULL);
|
| +
|
| + base::RunLoop run_loop;
|
| + MockBaseScreenDelegate mock_base_screen_delegate;
|
| + static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ =
|
| + &mock_base_screen_delegate;
|
| +
|
| + ASSERT_EQ(WizardController::default_controller()->current_screen(),
|
| + enrollment_screen);
|
| +
|
| + EXPECT_CALL(mock_base_screen_delegate,
|
| + OnExit(_, BaseScreenDelegate::ENTERPRISE_ENROLLMENT_COMPLETED, _))
|
| + .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit));
|
| + ASSERT_EQ(EnrollmentScreen::AUTH_OAUTH, enrollment_screen->last_auth_);
|
| + ASSERT_EQ(EnrollmentScreen::AUTH_ATTESTATION,
|
| + enrollment_screen->current_auth_);
|
| + ASSERT_TRUE(enrollment_screen->AdvanceToNextAuth());
|
| + ASSERT_EQ(EnrollmentScreen::AUTH_OAUTH, enrollment_screen->current_auth_);
|
| + enrollment_screen->OnCancel();
|
| + content::RunThisRunLoop(&run_loop);
|
| + Mock::VerifyAndClearExpectations(&mock_base_screen_delegate);
|
| +
|
| + static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ =
|
| + WizardController::default_controller();
|
| +}
|
| +
|
| +class AttestationAuthEnrollmentScreenTest : public EnrollmentScreenTest {
|
| + public:
|
| + AttestationAuthEnrollmentScreenTest() {}
|
| +
|
| + private:
|
| + // Overridden from InProcessBrowserTest:
|
| + void SetUpCommandLine(base::CommandLine* command_line) override {
|
| + command_line->AppendSwitchASCII(
|
| + switches::kEnterpriseEnableZeroTouchEnrollment, "forced");
|
| + }
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(AttestationAuthEnrollmentScreenTest);
|
| +};
|
| +
|
| +IN_PROC_BROWSER_TEST_F(AttestationAuthEnrollmentScreenTest, TestCancel) {
|
| + ASSERT_TRUE(WizardController::default_controller() != NULL);
|
| +
|
| + EnrollmentScreen* enrollment_screen =
|
| + EnrollmentScreen::Get(WizardController::default_controller());
|
| + ASSERT_TRUE(enrollment_screen != NULL);
|
| +
|
| + base::RunLoop run_loop;
|
| + MockBaseScreenDelegate mock_base_screen_delegate;
|
| + static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ =
|
| + &mock_base_screen_delegate;
|
| +
|
| + ASSERT_EQ(WizardController::default_controller()->current_screen(),
|
| + enrollment_screen);
|
| +
|
| + EXPECT_CALL(mock_base_screen_delegate,
|
| + OnExit(_, BaseScreenDelegate::ENTERPRISE_ENROLLMENT_BACK, _))
|
| + .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit));
|
| + ASSERT_EQ(EnrollmentScreen::AUTH_ATTESTATION, enrollment_screen->last_auth_);
|
| + ASSERT_EQ(EnrollmentScreen::AUTH_ATTESTATION,
|
| + enrollment_screen->current_auth_);
|
| + enrollment_screen->OnCancel();
|
| + ASSERT_EQ(EnrollmentScreen::AUTH_ATTESTATION,
|
| + enrollment_screen->current_auth_);
|
| + content::RunThisRunLoop(&run_loop);
|
| + Mock::VerifyAndClearExpectations(&mock_base_screen_delegate);
|
| +
|
| + static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ =
|
| + WizardController::default_controller();
|
| +}
|
| +
|
| class ProvisionedEnrollmentScreenTest : public EnrollmentScreenTest {
|
| public:
|
| ProvisionedEnrollmentScreenTest() {}
|
|
|