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 "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/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 WizardControllerDeviceStateTest() | 724 WizardControllerDeviceStateTest() |
725 : install_attributes_(std::string(), | 725 : install_attributes_(std::string(), |
726 std::string(), | 726 std::string(), |
727 std::string(), | 727 std::string(), |
728 policy::DEVICE_MODE_NOT_SET) { | 728 policy::DEVICE_MODE_NOT_SET) { |
729 fake_statistics_provider_.SetMachineStatistic("serial_number", "test"); | 729 fake_statistics_provider_.SetMachineStatistic("serial_number", "test"); |
730 fake_statistics_provider_.SetMachineStatistic(system::kActivateDateKey, | 730 fake_statistics_provider_.SetMachineStatistic(system::kActivateDateKey, |
731 "2000-01"); | 731 "2000-01"); |
732 } | 732 } |
733 | 733 |
734 virtual void SetUpCommandLine(CommandLine* command_line) override { | 734 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
735 WizardControllerFlowTest::SetUpCommandLine(command_line); | 735 WizardControllerFlowTest::SetUpCommandLine(command_line); |
736 | 736 |
737 command_line->AppendSwitchASCII( | 737 command_line->AppendSwitchASCII( |
738 switches::kEnterpriseEnableForcedReEnrollment, | 738 switches::kEnterpriseEnableForcedReEnrollment, |
739 chromeos::AutoEnrollmentController::kForcedReEnrollmentAlways); | 739 chromeos::AutoEnrollmentController::kForcedReEnrollmentAlways); |
740 command_line->AppendSwitchASCII( | 740 command_line->AppendSwitchASCII( |
741 switches::kEnterpriseEnrollmentInitialModulus, "1"); | 741 switches::kEnterpriseEnrollmentInitialModulus, "1"); |
742 command_line->AppendSwitchASCII( | 742 command_line->AppendSwitchASCII( |
743 switches::kEnterpriseEnrollmentModulusLimit, "2"); | 743 switches::kEnterpriseEnrollmentModulusLimit, "2"); |
744 } | 744 } |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 ASSERT_TRUE(proxy_server_.Start()); | 973 ASSERT_TRUE(proxy_server_.Start()); |
974 WizardControllerTest::SetUp(); | 974 WizardControllerTest::SetUp(); |
975 } | 975 } |
976 | 976 |
977 virtual void SetUpOnMainThread() override { | 977 virtual void SetUpOnMainThread() override { |
978 WizardControllerTest::SetUpOnMainThread(); | 978 WizardControllerTest::SetUpOnMainThread(); |
979 WizardController::default_controller()->AdvanceToScreen( | 979 WizardController::default_controller()->AdvanceToScreen( |
980 WizardController::kNetworkScreenName); | 980 WizardController::kNetworkScreenName); |
981 } | 981 } |
982 | 982 |
983 virtual void SetUpCommandLine(CommandLine* command_line) override { | 983 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
984 command_line->AppendSwitchASCII(::switches::kProxyServer, | 984 command_line->AppendSwitchASCII(::switches::kProxyServer, |
985 proxy_server_.host_port_pair().ToString()); | 985 proxy_server_.host_port_pair().ToString()); |
986 } | 986 } |
987 | 987 |
988 net::SpawnedTestServer& proxy_server() { return proxy_server_; } | 988 net::SpawnedTestServer& proxy_server() { return proxy_server_; } |
989 | 989 |
990 private: | 990 private: |
991 net::SpawnedTestServer proxy_server_; | 991 net::SpawnedTestServer proxy_server_; |
992 | 992 |
993 DISALLOW_COPY_AND_ASSIGN(WizardControllerProxyAuthOnSigninTest); | 993 DISALLOW_COPY_AND_ASSIGN(WizardControllerProxyAuthOnSigninTest); |
994 }; | 994 }; |
995 | 995 |
996 IN_PROC_BROWSER_TEST_F(WizardControllerProxyAuthOnSigninTest, | 996 IN_PROC_BROWSER_TEST_F(WizardControllerProxyAuthOnSigninTest, |
997 ProxyAuthDialogOnSigninScreen) { | 997 ProxyAuthDialogOnSigninScreen) { |
998 content::WindowedNotificationObserver auth_needed_waiter( | 998 content::WindowedNotificationObserver auth_needed_waiter( |
999 chrome::NOTIFICATION_AUTH_NEEDED, | 999 chrome::NOTIFICATION_AUTH_NEEDED, |
1000 content::NotificationService::AllSources()); | 1000 content::NotificationService::AllSources()); |
1001 | 1001 |
1002 CheckCurrentScreen(WizardController::kNetworkScreenName); | 1002 CheckCurrentScreen(WizardController::kNetworkScreenName); |
1003 | 1003 |
1004 LoginDisplayHostImpl::default_host()->StartSignInScreen(LoginScreenContext()); | 1004 LoginDisplayHostImpl::default_host()->StartSignInScreen(LoginScreenContext()); |
1005 auth_needed_waiter.Wait(); | 1005 auth_needed_waiter.Wait(); |
1006 } | 1006 } |
1007 | 1007 |
1008 class WizardControllerKioskFlowTest : public WizardControllerFlowTest { | 1008 class WizardControllerKioskFlowTest : public WizardControllerFlowTest { |
1009 protected: | 1009 protected: |
1010 WizardControllerKioskFlowTest() {} | 1010 WizardControllerKioskFlowTest() {} |
1011 | 1011 |
1012 // Overridden from InProcessBrowserTest: | 1012 // Overridden from InProcessBrowserTest: |
1013 virtual void SetUpCommandLine(CommandLine* command_line) override { | 1013 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
1014 base::FilePath test_data_dir; | 1014 base::FilePath test_data_dir; |
1015 ASSERT_TRUE(chromeos::test_utils::GetTestDataPath( | 1015 ASSERT_TRUE(chromeos::test_utils::GetTestDataPath( |
1016 "app_mode", "kiosk_manifest", &test_data_dir)); | 1016 "app_mode", "kiosk_manifest", &test_data_dir)); |
1017 command_line->AppendSwitchPath( | 1017 command_line->AppendSwitchPath( |
1018 switches::kAppOemManifestFile, | 1018 switches::kAppOemManifestFile, |
1019 test_data_dir.AppendASCII("kiosk_manifest.json")); | 1019 test_data_dir.AppendASCII("kiosk_manifest.json")); |
1020 } | 1020 } |
1021 | 1021 |
1022 private: | 1022 private: |
1023 DISALLOW_COPY_AND_ASSIGN(WizardControllerKioskFlowTest); | 1023 DISALLOW_COPY_AND_ASSIGN(WizardControllerKioskFlowTest); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1110 CheckCurrentScreen(WizardController::kAutoEnrollmentCheckScreenName); | 1110 CheckCurrentScreen(WizardController::kAutoEnrollmentCheckScreenName); |
1111 EXPECT_FALSE(StartupUtils::IsOobeCompleted()); | 1111 EXPECT_FALSE(StartupUtils::IsOobeCompleted()); |
1112 } | 1112 } |
1113 | 1113 |
1114 | 1114 |
1115 class WizardControllerEnableDebuggingTest : public WizardControllerFlowTest { | 1115 class WizardControllerEnableDebuggingTest : public WizardControllerFlowTest { |
1116 protected: | 1116 protected: |
1117 WizardControllerEnableDebuggingTest() {} | 1117 WizardControllerEnableDebuggingTest() {} |
1118 | 1118 |
1119 // Overridden from InProcessBrowserTest: | 1119 // Overridden from InProcessBrowserTest: |
1120 virtual void SetUpCommandLine(CommandLine* command_line) override { | 1120 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
1121 WizardControllerFlowTest::SetUpCommandLine(command_line); | 1121 WizardControllerFlowTest::SetUpCommandLine(command_line); |
1122 command_line->AppendSwitch(chromeos::switches::kSystemDevMode); | 1122 command_line->AppendSwitch(chromeos::switches::kSystemDevMode); |
1123 } | 1123 } |
1124 | 1124 |
1125 private: | 1125 private: |
1126 DISALLOW_COPY_AND_ASSIGN(WizardControllerEnableDebuggingTest); | 1126 DISALLOW_COPY_AND_ASSIGN(WizardControllerEnableDebuggingTest); |
1127 }; | 1127 }; |
1128 | 1128 |
1129 IN_PROC_BROWSER_TEST_F(WizardControllerEnableDebuggingTest, | 1129 IN_PROC_BROWSER_TEST_F(WizardControllerEnableDebuggingTest, |
1130 ShowAndCancelEnableDebugging) { | 1130 ShowAndCancelEnableDebugging) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1226 // TODO(merkulova): Add tests for bluetooth HID detection screen variations when | 1226 // TODO(merkulova): Add tests for bluetooth HID detection screen variations when |
1227 // UI and logic is ready. http://crbug.com/127016 | 1227 // UI and logic is ready. http://crbug.com/127016 |
1228 | 1228 |
1229 // TODO(dzhioev): Add tests for controller/host pairing flow. | 1229 // TODO(dzhioev): Add tests for controller/host pairing flow. |
1230 // http://crbug.com/375191 | 1230 // http://crbug.com/375191 |
1231 | 1231 |
1232 COMPILE_ASSERT(BaseScreenDelegate::EXIT_CODES_COUNT == 24, | 1232 COMPILE_ASSERT(BaseScreenDelegate::EXIT_CODES_COUNT == 24, |
1233 add_tests_for_new_control_flow_you_just_introduced); | 1233 add_tests_for_new_control_flow_you_just_introduced); |
1234 | 1234 |
1235 } // namespace chromeos | 1235 } // namespace chromeos |
OLD | NEW |