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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
862 // Make sure enterprise enrollment page shows up right after update screen. | 862 // Make sure enterprise enrollment page shows up right after update screen. |
863 EnrollmentScreen* screen = | 863 EnrollmentScreen* screen = |
864 WizardController::default_controller()->GetEnrollmentScreen(); | 864 WizardController::default_controller()->GetEnrollmentScreen(); |
865 EXPECT_EQ(screen, WizardController::default_controller()->current_screen()); | 865 EXPECT_EQ(screen, WizardController::default_controller()->current_screen()); |
866 OnExit(ScreenObserver::ENTERPRISE_ENROLLMENT_BACK); | 866 OnExit(ScreenObserver::ENTERPRISE_ENROLLMENT_BACK); |
867 | 867 |
868 EXPECT_EQ(WizardController::default_controller()->GetNetworkScreen(), | 868 EXPECT_EQ(WizardController::default_controller()->GetNetworkScreen(), |
869 WizardController::default_controller()->current_screen()); | 869 WizardController::default_controller()->current_screen()); |
870 EXPECT_FALSE(StartupUtils::IsOobeCompleted()); | 870 EXPECT_FALSE(StartupUtils::IsOobeCompleted()); |
871 } | 871 } |
872 | 872 |
Mattias Nissler (ping if slow)
2014/05/15 09:30:25
remove extra blank line.
pastarmovj
2014/05/19 14:12:27
Done.
| |
873 | |
874 class WizardControllerOobeResumeTest : public WizardControllerTest { | |
875 protected: | |
876 WizardControllerOobeResumeTest() {} | |
877 // Overriden from InProcessBrowserTest: | |
878 virtual void SetUpOnMainThread() OVERRIDE { | |
879 WizardControllerTest::SetUpOnMainThread(); | |
880 | |
881 // Make sure that OOBE is run as an "official" build. | |
882 WizardController::default_controller()->is_official_build_ = true; | |
883 | |
884 // Clear portal list (as it is by default in OOBE). | |
885 NetworkHandler::Get()->network_state_handler()->SetCheckPortalList(""); | |
886 | |
887 // Set up the mocks for all screens. | |
888 MOCK(mock_network_screen_, network_screen_, | |
889 MockNetworkScreen, MockNetworkScreenActor); | |
890 MOCK(mock_enrollment_screen_, enrollment_screen_, | |
891 MockEnrollmentScreen, MockEnrollmentScreenActor); | |
892 } | |
893 | |
894 void OnExit(ScreenObserver::ExitCodes exit_code) { | |
895 WizardController::default_controller()->OnExit(exit_code); | |
896 } | |
897 | |
898 std::string GetFirstScreenName() { | |
899 return WizardController::default_controller()->first_screen_name(); | |
900 } | |
901 | |
902 MockOutShowHide<MockNetworkScreen, MockNetworkScreenActor>* | |
903 mock_network_screen_; | |
904 MockOutShowHide<MockEnrollmentScreen, | |
905 MockEnrollmentScreenActor>* mock_enrollment_screen_; | |
906 | |
907 private: | |
908 DISALLOW_COPY_AND_ASSIGN(WizardControllerOobeResumeTest); | |
909 }; | |
910 | |
911 IN_PROC_BROWSER_TEST_F(WizardControllerOobeResumeTest, | |
912 PRE_ControlFlowResumeInterruptedOobe) { | |
913 // Switch to the initial screen. | |
914 EXPECT_CALL(*mock_network_screen_, Show()).Times(1); | |
915 WizardController::default_controller()->AdvanceToScreen( | |
916 WizardController::kNetworkScreenName); | |
917 EXPECT_EQ(WizardController::default_controller()->GetNetworkScreen(), | |
918 WizardController::default_controller()->current_screen()); | |
919 EXPECT_CALL(*mock_enrollment_screen_->actor(), | |
920 SetParameters(mock_enrollment_screen_, | |
921 EnrollmentScreenActor::ENROLLMENT_MODE_MANUAL, | |
922 "")) | |
923 .Times(1); | |
924 EXPECT_CALL(*mock_enrollment_screen_, Show()).Times(1); | |
925 EXPECT_CALL(*mock_network_screen_, Hide()).Times(1); | |
926 | |
927 WizardController::default_controller()->AdvanceToScreen( | |
928 WizardController::kEnrollmentScreenName); | |
929 EXPECT_EQ(WizardController::default_controller()->GetEnrollmentScreen(), | |
930 WizardController::default_controller()->current_screen()); | |
931 } | |
932 | |
933 IN_PROC_BROWSER_TEST_F(WizardControllerOobeResumeTest, | |
934 ControlFlowResumeInterruptedOobe) { | |
935 EXPECT_EQ(WizardController::kEnrollmentScreenName, GetFirstScreenName()); | |
936 } | |
937 | |
873 // TODO(dzhioev): Add test emaulating device with wrong HWID. | 938 // TODO(dzhioev): Add test emaulating device with wrong HWID. |
874 | 939 |
875 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571 | 940 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571 |
876 | 941 |
877 // TODO(merkulova): Add tests for bluetooth HID detection screen variations when | 942 // TODO(merkulova): Add tests for bluetooth HID detection screen variations when |
878 // UI and logic is ready. http://crbug.com/127016 | 943 // UI and logic is ready. http://crbug.com/127016 |
879 | 944 |
880 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 21, | 945 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 21, |
881 add_tests_for_new_control_flow_you_just_introduced); | 946 add_tests_for_new_control_flow_you_just_introduced); |
882 | 947 |
883 } // namespace chromeos | 948 } // namespace chromeos |
OLD | NEW |