Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: chrome/browser/chromeos/login/wizard_controller_browsertest.cc

Issue 692383005: Add DeviceDisablingManager to manage device disabling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@f_3_425574_disable_header_bar
Patch Set: Move the parsing of the disabled message to DeviceDisablingManager as well. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "chrome/browser/chromeos/login/wizard_controller.h" 5 #include "chrome/browser/chromeos/login/wizard_controller.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 547
548 // Let update screen smooth time process (time = 0ms). 548 // Let update screen smooth time process (time = 0ms).
549 content::RunAllPendingInMessageLoop(); 549 content::RunAllPendingInMessageLoop();
550 550
551 CheckCurrentScreen(WizardController::kUpdateScreenName); 551 CheckCurrentScreen(WizardController::kUpdateScreenName);
552 EXPECT_CALL(*mock_update_screen_, Hide()).Times(1); 552 EXPECT_CALL(*mock_update_screen_, Hide()).Times(1);
553 EXPECT_CALL(*mock_auto_enrollment_check_screen_, Show()).Times(1); 553 EXPECT_CALL(*mock_auto_enrollment_check_screen_, Show()).Times(1);
554 OnExit(BaseScreenDelegate::UPDATE_INSTALLED); 554 OnExit(BaseScreenDelegate::UPDATE_INSTALLED);
555 555
556 CheckCurrentScreen(WizardController::kAutoEnrollmentCheckScreenName); 556 CheckCurrentScreen(WizardController::kAutoEnrollmentCheckScreenName);
557 EXPECT_CALL(*mock_auto_enrollment_check_screen_, Hide()).Times(1); 557 EXPECT_CALL(*mock_auto_enrollment_check_screen_, Hide()).Times(0);
558 EXPECT_CALL(*mock_eula_screen_, Show()).Times(0); 558 EXPECT_CALL(*mock_eula_screen_, Show()).Times(0);
559 OnExit(BaseScreenDelegate::ENTERPRISE_AUTO_ENROLLMENT_CHECK_COMPLETED); 559 OnExit(BaseScreenDelegate::ENTERPRISE_AUTO_ENROLLMENT_CHECK_COMPLETED);
560 560
561 EXPECT_FALSE(ExistingUserController::current_controller() == NULL); 561 EXPECT_FALSE(ExistingUserController::current_controller() == NULL);
562 EXPECT_EQ("ethernet,wifi,cellular", 562 EXPECT_EQ("ethernet,wifi,cellular",
563 NetworkHandler::Get()->network_state_handler() 563 NetworkHandler::Get()->network_state_handler()
564 ->GetCheckPortalListForTest()); 564 ->GetCheckPortalListForTest());
565 565
566 WaitUntilTimezoneResolved(); 566 WaitUntilTimezoneResolved();
567 EXPECT_EQ("America/Anchorage", 567 EXPECT_EQ("America/Anchorage",
(...skipping 17 matching lines...) Expand all
585 585
586 // Let update screen smooth time process (time = 0ms). 586 // Let update screen smooth time process (time = 0ms).
587 content::RunAllPendingInMessageLoop(); 587 content::RunAllPendingInMessageLoop();
588 588
589 CheckCurrentScreen(WizardController::kUpdateScreenName); 589 CheckCurrentScreen(WizardController::kUpdateScreenName);
590 EXPECT_CALL(*mock_update_screen_, Hide()).Times(1); 590 EXPECT_CALL(*mock_update_screen_, Hide()).Times(1);
591 EXPECT_CALL(*mock_auto_enrollment_check_screen_, Show()).Times(1); 591 EXPECT_CALL(*mock_auto_enrollment_check_screen_, Show()).Times(1);
592 OnExit(BaseScreenDelegate::UPDATE_ERROR_UPDATING); 592 OnExit(BaseScreenDelegate::UPDATE_ERROR_UPDATING);
593 593
594 CheckCurrentScreen(WizardController::kAutoEnrollmentCheckScreenName); 594 CheckCurrentScreen(WizardController::kAutoEnrollmentCheckScreenName);
595 EXPECT_CALL(*mock_auto_enrollment_check_screen_, Hide()).Times(1); 595 EXPECT_CALL(*mock_auto_enrollment_check_screen_, Hide()).Times(0);
596 EXPECT_CALL(*mock_eula_screen_, Show()).Times(0); 596 EXPECT_CALL(*mock_eula_screen_, Show()).Times(0);
597 OnExit(BaseScreenDelegate::ENTERPRISE_AUTO_ENROLLMENT_CHECK_COMPLETED); 597 OnExit(BaseScreenDelegate::ENTERPRISE_AUTO_ENROLLMENT_CHECK_COMPLETED);
598 598
599 EXPECT_FALSE(ExistingUserController::current_controller() == NULL); 599 EXPECT_FALSE(ExistingUserController::current_controller() == NULL);
600 } 600 }
601 601
602 IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, ControlFlowSkipUpdateEnroll) { 602 IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, ControlFlowSkipUpdateEnroll) {
603 CheckCurrentScreen(WizardController::kNetworkScreenName); 603 CheckCurrentScreen(WizardController::kNetworkScreenName);
604 EXPECT_CALL(*mock_update_screen_, StartNetworkCheck()).Times(0); 604 EXPECT_CALL(*mock_update_screen_, StartNetworkCheck()).Times(0);
605 EXPECT_CALL(*mock_eula_screen_, Show()).Times(1); 605 EXPECT_CALL(*mock_eula_screen_, Show()).Times(1);
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 833
834 CheckCurrentScreen(WizardController::kUpdateScreenName); 834 CheckCurrentScreen(WizardController::kUpdateScreenName);
835 EXPECT_CALL(*mock_update_screen_, Hide()).Times(1); 835 EXPECT_CALL(*mock_update_screen_, Hide()).Times(1);
836 EXPECT_CALL(*mock_auto_enrollment_check_screen_, Show()).Times(1); 836 EXPECT_CALL(*mock_auto_enrollment_check_screen_, Show()).Times(1);
837 OnExit(BaseScreenDelegate::UPDATE_INSTALLED); 837 OnExit(BaseScreenDelegate::UPDATE_INSTALLED);
838 838
839 AutoEnrollmentCheckScreen* screen = 839 AutoEnrollmentCheckScreen* screen =
840 AutoEnrollmentCheckScreen::Get(WizardController::default_controller()); 840 AutoEnrollmentCheckScreen::Get(WizardController::default_controller());
841 EXPECT_EQ(screen, 841 EXPECT_EQ(screen,
842 WizardController::default_controller()->current_screen()); 842 WizardController::default_controller()->current_screen());
843 EXPECT_CALL(*mock_auto_enrollment_check_screen_, Hide()).Times(1);
844 screen->Start(); 843 screen->Start();
845 EXPECT_EQ(policy::AUTO_ENROLLMENT_STATE_NO_ENROLLMENT, 844 EXPECT_EQ(policy::AUTO_ENROLLMENT_STATE_NO_ENROLLMENT,
846 LoginDisplayHostImpl::default_host() 845 LoginDisplayHostImpl::default_host()
847 ->GetAutoEnrollmentController() 846 ->GetAutoEnrollmentController()
848 ->state()); 847 ->state());
849 } 848 }
850 849
851 IN_PROC_BROWSER_TEST_F(WizardControllerDeviceStateTest, 850 IN_PROC_BROWSER_TEST_F(WizardControllerDeviceStateTest,
852 ControlFlowDeviceDisabled) { 851 ControlFlowDeviceDisabled) {
853 CheckCurrentScreen(WizardController::kNetworkScreenName); 852 CheckCurrentScreen(WizardController::kNetworkScreenName);
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 // TODO(dzhioev): Add test emaulating device with wrong HWID. 1184 // TODO(dzhioev): Add test emaulating device with wrong HWID.
1186 1185
1187 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571 1186 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571
1188 1187
1189 // TODO(merkulova): Add tests for bluetooth HID detection screen variations when 1188 // TODO(merkulova): Add tests for bluetooth HID detection screen variations when
1190 // UI and logic is ready. http://crbug.com/127016 1189 // UI and logic is ready. http://crbug.com/127016
1191 1190
1192 // TODO(dzhioev): Add tests for controller/host pairing flow. 1191 // TODO(dzhioev): Add tests for controller/host pairing flow.
1193 // http://crbug.com/375191 1192 // http://crbug.com/375191
1194 1193
1195 COMPILE_ASSERT(BaseScreenDelegate::EXIT_CODES_COUNT == 24, 1194 COMPILE_ASSERT(BaseScreenDelegate::EXIT_CODES_COUNT == 23,
1196 add_tests_for_new_control_flow_you_just_introduced); 1195 add_tests_for_new_control_flow_you_just_introduced);
1197 1196
1198 } // namespace chromeos 1197 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698