OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <memory> | 5 #include <memory> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "ash/desktop_background/desktop_background_controller.h" | 8 #include "ash/desktop_background/desktop_background_controller.h" |
9 #include "ash/desktop_background/desktop_background_controller_observer.h" | 9 #include "ash/desktop_background/desktop_background_controller_observer.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 EXPECT_EQ(base::WriteFile(cache_init_file, "", 0), 0); | 552 EXPECT_EQ(base::WriteFile(cache_init_file, "", 0), 0); |
553 } | 553 } |
554 | 554 |
555 void SetUpCommandLine(base::CommandLine* command_line) override { | 555 void SetUpCommandLine(base::CommandLine* command_line) override { |
556 OobeBaseTest::SetUpCommandLine(command_line); | 556 OobeBaseTest::SetUpCommandLine(command_line); |
557 fake_cws_->Init(embedded_test_server()); | 557 fake_cws_->Init(embedded_test_server()); |
558 } | 558 } |
559 | 559 |
560 void LaunchApp(const std::string& app_id, bool diagnostic_mode) { | 560 void LaunchApp(const std::string& app_id, bool diagnostic_mode) { |
561 bool new_kiosk_ui = KioskAppMenuHandler::EnableNewKioskUI(); | 561 bool new_kiosk_ui = KioskAppMenuHandler::EnableNewKioskUI(); |
562 GetLoginUI()->CallJavascriptFunction(new_kiosk_ui ? | 562 GetLoginUI()->CallJavascriptFunctionUnsafe( |
563 kLaunchAppForTestNewAPI : kLaunchAppForTestOldAPI, | 563 new_kiosk_ui ? kLaunchAppForTestNewAPI : kLaunchAppForTestOldAPI, |
564 base::StringValue(app_id), | 564 base::StringValue(app_id), base::FundamentalValue(diagnostic_mode)); |
565 base::FundamentalValue(diagnostic_mode)); | |
566 } | 565 } |
567 | 566 |
568 void ReloadKioskApps() { | 567 void ReloadKioskApps() { |
569 SetupTestAppUpdateCheck(); | 568 SetupTestAppUpdateCheck(); |
570 | 569 |
571 // Remove then add to ensure NOTIFICATION_KIOSK_APPS_LOADED fires. | 570 // Remove then add to ensure NOTIFICATION_KIOSK_APPS_LOADED fires. |
572 KioskAppManager::Get()->RemoveApp(test_app_id_, | 571 KioskAppManager::Get()->RemoveApp(test_app_id_, |
573 owner_settings_service_.get()); | 572 owner_settings_service_.get()); |
574 KioskAppManager::Get()->AddApp(test_app_id_, owner_settings_service_.get()); | 573 KioskAppManager::Get()->AddApp(test_app_id_, owner_settings_service_.get()); |
575 } | 574 } |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 std::unique_ptr<base::AutoLock> lock = LockFileThread(); | 958 std::unique_ptr<base::AutoLock> lock = LockFileThread(); |
960 | 959 |
961 // Start app launch and wait for network connectivity timeout. | 960 // Start app launch and wait for network connectivity timeout. |
962 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); | 961 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); |
963 OobeScreenWaiter splash_waiter(OobeScreen::SCREEN_APP_LAUNCH_SPLASH); | 962 OobeScreenWaiter splash_waiter(OobeScreen::SCREEN_APP_LAUNCH_SPLASH); |
964 splash_waiter.Wait(); | 963 splash_waiter.Wait(); |
965 | 964 |
966 // A network error screen should be shown after authenticating. | 965 // A network error screen should be shown after authenticating. |
967 OobeScreenWaiter error_screen_waiter(OobeScreen::SCREEN_ERROR_MESSAGE); | 966 OobeScreenWaiter error_screen_waiter(OobeScreen::SCREEN_ERROR_MESSAGE); |
968 // Simulate Ctrl+Alt+N accelerator. | 967 // Simulate Ctrl+Alt+N accelerator. |
969 GetLoginUI()->CallJavascriptFunction( | 968 GetLoginUI()->CallJavascriptFunctionUnsafe( |
970 "cr.ui.Oobe.handleAccelerator", | 969 "cr.ui.Oobe.handleAccelerator", |
971 base::StringValue("app_launch_network_config")); | 970 base::StringValue("app_launch_network_config")); |
972 error_screen_waiter.Wait(); | 971 error_screen_waiter.Wait(); |
973 ASSERT_TRUE(GetAppLaunchController()->showing_network_dialog()); | 972 ASSERT_TRUE(GetAppLaunchController()->showing_network_dialog()); |
974 | 973 |
975 // Continue button should be visible since we are online. | 974 // Continue button should be visible since we are online. |
976 JsExpect("$('continue-network-config-btn').hidden == false"); | 975 JsExpect("$('continue-network-config-btn').hidden == false"); |
977 | 976 |
978 // Click on [Continue] button. | 977 // Click on [Continue] button. |
979 ASSERT_TRUE(content::ExecuteScript( | 978 ASSERT_TRUE(content::ExecuteScript( |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 set_test_app_version(""); | 1031 set_test_app_version(""); |
1033 StartAppLaunchFromLoginScreen(SimulateNetworkOfflineClosure()); | 1032 StartAppLaunchFromLoginScreen(SimulateNetworkOfflineClosure()); |
1034 OobeScreenWaiter splash_waiter(OobeScreen::SCREEN_APP_LAUNCH_SPLASH); | 1033 OobeScreenWaiter splash_waiter(OobeScreen::SCREEN_APP_LAUNCH_SPLASH); |
1035 splash_waiter.Wait(); | 1034 splash_waiter.Wait(); |
1036 | 1035 |
1037 settings_helper_.SetBoolean( | 1036 settings_helper_.SetBoolean( |
1038 kAccountsPrefDeviceLocalAccountAutoLoginBailoutEnabled, true); | 1037 kAccountsPrefDeviceLocalAccountAutoLoginBailoutEnabled, true); |
1039 content::WindowedNotificationObserver signal( | 1038 content::WindowedNotificationObserver signal( |
1040 chrome::NOTIFICATION_APP_TERMINATING, | 1039 chrome::NOTIFICATION_APP_TERMINATING, |
1041 content::NotificationService::AllSources()); | 1040 content::NotificationService::AllSources()); |
1042 GetLoginUI()->CallJavascriptFunction("cr.ui.Oobe.handleAccelerator", | 1041 GetLoginUI()->CallJavascriptFunctionUnsafe( |
1043 base::StringValue("app_launch_bailout")); | 1042 "cr.ui.Oobe.handleAccelerator", base::StringValue("app_launch_bailout")); |
1044 signal.Wait(); | 1043 signal.Wait(); |
1045 EXPECT_EQ(chromeos::KioskAppLaunchError::USER_CANCEL, | 1044 EXPECT_EQ(chromeos::KioskAppLaunchError::USER_CANCEL, |
1046 chromeos::KioskAppLaunchError::Get()); | 1045 chromeos::KioskAppLaunchError::Get()); |
1047 } | 1046 } |
1048 | 1047 |
1049 IN_PROC_BROWSER_TEST_F(KioskTest, LaunchInDiagnosticMode) { | 1048 IN_PROC_BROWSER_TEST_F(KioskTest, LaunchInDiagnosticMode) { |
1050 PrepareAppLaunch(); | 1049 PrepareAppLaunch(); |
1051 SimulateNetworkOnline(); | 1050 SimulateNetworkOnline(); |
1052 | 1051 |
1053 LaunchApp(kTestKioskApp, true); | 1052 LaunchApp(kTestKioskApp, true); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 wizard_controller->AdvanceToScreen(WizardController::kNetworkScreenName); | 1084 wizard_controller->AdvanceToScreen(WizardController::kNetworkScreenName); |
1086 ReloadAutolaunchKioskApps(); | 1085 ReloadAutolaunchKioskApps(); |
1087 EXPECT_FALSE(KioskAppManager::Get()->GetAutoLaunchApp().empty()); | 1086 EXPECT_FALSE(KioskAppManager::Get()->GetAutoLaunchApp().empty()); |
1088 EXPECT_FALSE(KioskAppManager::Get()->IsAutoLaunchEnabled()); | 1087 EXPECT_FALSE(KioskAppManager::Get()->IsAutoLaunchEnabled()); |
1089 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); | 1088 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); |
1090 | 1089 |
1091 // Wait for the auto launch warning come up. | 1090 // Wait for the auto launch warning come up. |
1092 content::WindowedNotificationObserver( | 1091 content::WindowedNotificationObserver( |
1093 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1092 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
1094 content::NotificationService::AllSources()).Wait(); | 1093 content::NotificationService::AllSources()).Wait(); |
1095 GetLoginUI()->CallJavascriptFunction( | 1094 GetLoginUI()->CallJavascriptFunctionUnsafe( |
1096 "login.AutolaunchScreen.confirmAutoLaunchForTesting", | 1095 "login.AutolaunchScreen.confirmAutoLaunchForTesting", |
1097 base::FundamentalValue(false)); | 1096 base::FundamentalValue(false)); |
1098 | 1097 |
1099 // Wait for the auto launch warning to go away. | 1098 // Wait for the auto launch warning to go away. |
1100 content::WindowedNotificationObserver( | 1099 content::WindowedNotificationObserver( |
1101 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_COMPLETED, | 1100 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_COMPLETED, |
1102 content::NotificationService::AllSources()).Wait(); | 1101 content::NotificationService::AllSources()).Wait(); |
1103 | 1102 |
1104 EXPECT_FALSE(KioskAppManager::Get()->IsAutoLaunchEnabled()); | 1103 EXPECT_FALSE(KioskAppManager::Get()->IsAutoLaunchEnabled()); |
1105 } | 1104 } |
(...skipping 11 matching lines...) Expand all Loading... |
1117 wizard_controller->AdvanceToScreen(WizardController::kNetworkScreenName); | 1116 wizard_controller->AdvanceToScreen(WizardController::kNetworkScreenName); |
1118 ReloadAutolaunchKioskApps(); | 1117 ReloadAutolaunchKioskApps(); |
1119 EXPECT_FALSE(KioskAppManager::Get()->GetAutoLaunchApp().empty()); | 1118 EXPECT_FALSE(KioskAppManager::Get()->GetAutoLaunchApp().empty()); |
1120 EXPECT_FALSE(KioskAppManager::Get()->IsAutoLaunchEnabled()); | 1119 EXPECT_FALSE(KioskAppManager::Get()->IsAutoLaunchEnabled()); |
1121 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); | 1120 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); |
1122 | 1121 |
1123 // Wait for the auto launch warning come up. | 1122 // Wait for the auto launch warning come up. |
1124 content::WindowedNotificationObserver( | 1123 content::WindowedNotificationObserver( |
1125 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1124 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
1126 content::NotificationService::AllSources()).Wait(); | 1125 content::NotificationService::AllSources()).Wait(); |
1127 GetLoginUI()->CallJavascriptFunction( | 1126 GetLoginUI()->CallJavascriptFunctionUnsafe( |
1128 "login.AutolaunchScreen.confirmAutoLaunchForTesting", | 1127 "login.AutolaunchScreen.confirmAutoLaunchForTesting", |
1129 base::FundamentalValue(true)); | 1128 base::FundamentalValue(true)); |
1130 | 1129 |
1131 // Wait for the auto launch warning to go away. | 1130 // Wait for the auto launch warning to go away. |
1132 content::WindowedNotificationObserver( | 1131 content::WindowedNotificationObserver( |
1133 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_COMPLETED, | 1132 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_COMPLETED, |
1134 content::NotificationService::AllSources()).Wait(); | 1133 content::NotificationService::AllSources()).Wait(); |
1135 | 1134 |
1136 EXPECT_FALSE(KioskAppManager::Get()->GetAutoLaunchApp().empty()); | 1135 EXPECT_FALSE(KioskAppManager::Get()->GetAutoLaunchApp().empty()); |
1137 EXPECT_TRUE(KioskAppManager::Get()->IsAutoLaunchEnabled()); | 1136 EXPECT_TRUE(KioskAppManager::Get()->IsAutoLaunchEnabled()); |
(...skipping 12 matching lines...) Expand all Loading... |
1150 chromeos::WizardController::default_controller(); | 1149 chromeos::WizardController::default_controller(); |
1151 CHECK(wizard_controller); | 1150 CHECK(wizard_controller); |
1152 | 1151 |
1153 // Check Kiosk mode status. | 1152 // Check Kiosk mode status. |
1154 EXPECT_EQ(KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_CONFIGURABLE, | 1153 EXPECT_EQ(KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_CONFIGURABLE, |
1155 GetConsumerKioskModeStatus()); | 1154 GetConsumerKioskModeStatus()); |
1156 | 1155 |
1157 // Wait for the login UI to come up and switch to the kiosk_enable screen. | 1156 // Wait for the login UI to come up and switch to the kiosk_enable screen. |
1158 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); | 1157 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); |
1159 OobeScreenWaiter(OobeScreen::SCREEN_GAIA_SIGNIN).Wait(); | 1158 OobeScreenWaiter(OobeScreen::SCREEN_GAIA_SIGNIN).Wait(); |
1160 GetLoginUI()->CallJavascriptFunction("cr.ui.Oobe.handleAccelerator", | 1159 GetLoginUI()->CallJavascriptFunctionUnsafe("cr.ui.Oobe.handleAccelerator", |
1161 base::StringValue("kiosk_enable")); | 1160 base::StringValue("kiosk_enable")); |
1162 | 1161 |
1163 // Wait for the kiosk_enable screen to show and cancel the screen. | 1162 // Wait for the kiosk_enable screen to show and cancel the screen. |
1164 content::WindowedNotificationObserver( | 1163 content::WindowedNotificationObserver( |
1165 chrome::NOTIFICATION_KIOSK_ENABLE_WARNING_VISIBLE, | 1164 chrome::NOTIFICATION_KIOSK_ENABLE_WARNING_VISIBLE, |
1166 content::NotificationService::AllSources()).Wait(); | 1165 content::NotificationService::AllSources()).Wait(); |
1167 GetLoginUI()->CallJavascriptFunction( | 1166 GetLoginUI()->CallJavascriptFunctionUnsafe( |
1168 "login.KioskEnableScreen.enableKioskForTesting", | 1167 "login.KioskEnableScreen.enableKioskForTesting", |
1169 base::FundamentalValue(false)); | 1168 base::FundamentalValue(false)); |
1170 | 1169 |
1171 // Wait for the kiosk_enable screen to disappear. | 1170 // Wait for the kiosk_enable screen to disappear. |
1172 content::WindowedNotificationObserver( | 1171 content::WindowedNotificationObserver( |
1173 chrome::NOTIFICATION_KIOSK_ENABLE_WARNING_COMPLETED, | 1172 chrome::NOTIFICATION_KIOSK_ENABLE_WARNING_COMPLETED, |
1174 content::NotificationService::AllSources()).Wait(); | 1173 content::NotificationService::AllSources()).Wait(); |
1175 | 1174 |
1176 // Check that the status still says configurable. | 1175 // Check that the status still says configurable. |
1177 EXPECT_EQ(KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_CONFIGURABLE, | 1176 EXPECT_EQ(KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_CONFIGURABLE, |
1178 GetConsumerKioskModeStatus()); | 1177 GetConsumerKioskModeStatus()); |
1179 } | 1178 } |
1180 | 1179 |
1181 IN_PROC_BROWSER_TEST_F(KioskTest, KioskEnableConfirmed) { | 1180 IN_PROC_BROWSER_TEST_F(KioskTest, KioskEnableConfirmed) { |
1182 // Start UI, find menu entry for this app and launch it. | 1181 // Start UI, find menu entry for this app and launch it. |
1183 chromeos::WizardController::SkipPostLoginScreensForTesting(); | 1182 chromeos::WizardController::SkipPostLoginScreensForTesting(); |
1184 chromeos::WizardController* wizard_controller = | 1183 chromeos::WizardController* wizard_controller = |
1185 chromeos::WizardController::default_controller(); | 1184 chromeos::WizardController::default_controller(); |
1186 CHECK(wizard_controller); | 1185 CHECK(wizard_controller); |
1187 | 1186 |
1188 // Check Kiosk mode status. | 1187 // Check Kiosk mode status. |
1189 EXPECT_EQ(KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_CONFIGURABLE, | 1188 EXPECT_EQ(KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_CONFIGURABLE, |
1190 GetConsumerKioskModeStatus()); | 1189 GetConsumerKioskModeStatus()); |
1191 | 1190 |
1192 // Wait for the login UI to come up and switch to the kiosk_enable screen. | 1191 // Wait for the login UI to come up and switch to the kiosk_enable screen. |
1193 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); | 1192 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); |
1194 OobeScreenWaiter(OobeScreen::SCREEN_GAIA_SIGNIN).Wait(); | 1193 OobeScreenWaiter(OobeScreen::SCREEN_GAIA_SIGNIN).Wait(); |
1195 GetLoginUI()->CallJavascriptFunction("cr.ui.Oobe.handleAccelerator", | 1194 GetLoginUI()->CallJavascriptFunctionUnsafe("cr.ui.Oobe.handleAccelerator", |
1196 base::StringValue("kiosk_enable")); | 1195 base::StringValue("kiosk_enable")); |
1197 | 1196 |
1198 // Wait for the kiosk_enable screen to show and cancel the screen. | 1197 // Wait for the kiosk_enable screen to show and cancel the screen. |
1199 content::WindowedNotificationObserver( | 1198 content::WindowedNotificationObserver( |
1200 chrome::NOTIFICATION_KIOSK_ENABLE_WARNING_VISIBLE, | 1199 chrome::NOTIFICATION_KIOSK_ENABLE_WARNING_VISIBLE, |
1201 content::NotificationService::AllSources()).Wait(); | 1200 content::NotificationService::AllSources()).Wait(); |
1202 GetLoginUI()->CallJavascriptFunction( | 1201 GetLoginUI()->CallJavascriptFunctionUnsafe( |
1203 "login.KioskEnableScreen.enableKioskForTesting", | 1202 "login.KioskEnableScreen.enableKioskForTesting", |
1204 base::FundamentalValue(true)); | 1203 base::FundamentalValue(true)); |
1205 | 1204 |
1206 // Wait for the signal that indicates Kiosk Mode is enabled. | 1205 // Wait for the signal that indicates Kiosk Mode is enabled. |
1207 content::WindowedNotificationObserver( | 1206 content::WindowedNotificationObserver( |
1208 chrome::NOTIFICATION_KIOSK_ENABLED, | 1207 chrome::NOTIFICATION_KIOSK_ENABLED, |
1209 content::NotificationService::AllSources()).Wait(); | 1208 content::NotificationService::AllSources()).Wait(); |
1210 EXPECT_EQ(KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_ENABLED, | 1209 EXPECT_EQ(KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_ENABLED, |
1211 GetConsumerKioskModeStatus()); | 1210 GetConsumerKioskModeStatus()); |
1212 } | 1211 } |
1213 | 1212 |
1214 IN_PROC_BROWSER_TEST_F(KioskTest, KioskEnableAfter2ndSigninScreen) { | 1213 IN_PROC_BROWSER_TEST_F(KioskTest, KioskEnableAfter2ndSigninScreen) { |
1215 chromeos::WizardController::SkipPostLoginScreensForTesting(); | 1214 chromeos::WizardController::SkipPostLoginScreensForTesting(); |
1216 chromeos::WizardController* wizard_controller = | 1215 chromeos::WizardController* wizard_controller = |
1217 chromeos::WizardController::default_controller(); | 1216 chromeos::WizardController::default_controller(); |
1218 CHECK(wizard_controller); | 1217 CHECK(wizard_controller); |
1219 | 1218 |
1220 // Check Kiosk mode status. | 1219 // Check Kiosk mode status. |
1221 EXPECT_EQ(KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_CONFIGURABLE, | 1220 EXPECT_EQ(KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_CONFIGURABLE, |
1222 GetConsumerKioskModeStatus()); | 1221 GetConsumerKioskModeStatus()); |
1223 | 1222 |
1224 // Wait for the login UI to come up and switch to the kiosk_enable screen. | 1223 // Wait for the login UI to come up and switch to the kiosk_enable screen. |
1225 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); | 1224 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); |
1226 OobeScreenWaiter(OobeScreen::SCREEN_GAIA_SIGNIN).Wait(); | 1225 OobeScreenWaiter(OobeScreen::SCREEN_GAIA_SIGNIN).Wait(); |
1227 GetLoginUI()->CallJavascriptFunction("cr.ui.Oobe.handleAccelerator", | 1226 GetLoginUI()->CallJavascriptFunctionUnsafe("cr.ui.Oobe.handleAccelerator", |
1228 base::StringValue("kiosk_enable")); | 1227 base::StringValue("kiosk_enable")); |
1229 | 1228 |
1230 // Wait for the kiosk_enable screen to show and cancel the screen. | 1229 // Wait for the kiosk_enable screen to show and cancel the screen. |
1231 content::WindowedNotificationObserver( | 1230 content::WindowedNotificationObserver( |
1232 chrome::NOTIFICATION_KIOSK_ENABLE_WARNING_VISIBLE, | 1231 chrome::NOTIFICATION_KIOSK_ENABLE_WARNING_VISIBLE, |
1233 content::NotificationService::AllSources()).Wait(); | 1232 content::NotificationService::AllSources()).Wait(); |
1234 GetLoginUI()->CallJavascriptFunction( | 1233 GetLoginUI()->CallJavascriptFunctionUnsafe( |
1235 "login.KioskEnableScreen.enableKioskForTesting", | 1234 "login.KioskEnableScreen.enableKioskForTesting", |
1236 base::FundamentalValue(false)); | 1235 base::FundamentalValue(false)); |
1237 | 1236 |
1238 // Wait for the kiosk_enable screen to disappear. | 1237 // Wait for the kiosk_enable screen to disappear. |
1239 content::WindowedNotificationObserver( | 1238 content::WindowedNotificationObserver( |
1240 chrome::NOTIFICATION_KIOSK_ENABLE_WARNING_COMPLETED, | 1239 chrome::NOTIFICATION_KIOSK_ENABLE_WARNING_COMPLETED, |
1241 content::NotificationService::AllSources()).Wait(); | 1240 content::NotificationService::AllSources()).Wait(); |
1242 | 1241 |
1243 // Show signin screen again. | 1242 // Show signin screen again. |
1244 LoginDisplayHost::default_host()->StartSignInScreen(LoginScreenContext()); | 1243 LoginDisplayHost::default_host()->StartSignInScreen(LoginScreenContext()); |
1245 OobeScreenWaiter(OobeScreen::SCREEN_GAIA_SIGNIN).Wait(); | 1244 OobeScreenWaiter(OobeScreen::SCREEN_GAIA_SIGNIN).Wait(); |
1246 | 1245 |
1247 // Show kiosk enable screen again. | 1246 // Show kiosk enable screen again. |
1248 GetLoginUI()->CallJavascriptFunction("cr.ui.Oobe.handleAccelerator", | 1247 GetLoginUI()->CallJavascriptFunctionUnsafe("cr.ui.Oobe.handleAccelerator", |
1249 base::StringValue("kiosk_enable")); | 1248 base::StringValue("kiosk_enable")); |
1250 | 1249 |
1251 // And it should show up. | 1250 // And it should show up. |
1252 content::WindowedNotificationObserver( | 1251 content::WindowedNotificationObserver( |
1253 chrome::NOTIFICATION_KIOSK_ENABLE_WARNING_VISIBLE, | 1252 chrome::NOTIFICATION_KIOSK_ENABLE_WARNING_VISIBLE, |
1254 content::NotificationService::AllSources()).Wait(); | 1253 content::NotificationService::AllSources()).Wait(); |
1255 } | 1254 } |
1256 | 1255 |
1257 IN_PROC_BROWSER_TEST_F(KioskTest, DoNotLaunchWhenUntrusted) { | 1256 IN_PROC_BROWSER_TEST_F(KioskTest, DoNotLaunchWhenUntrusted) { |
1258 PrepareAppLaunch(); | 1257 PrepareAppLaunch(); |
1259 SimulateNetworkOnline(); | 1258 SimulateNetworkOnline(); |
(...skipping 27 matching lines...) Expand all Loading... |
1287 chromeos::WizardController::SkipPostLoginScreensForTesting(); | 1286 chromeos::WizardController::SkipPostLoginScreensForTesting(); |
1288 chromeos::WizardController* wizard_controller = | 1287 chromeos::WizardController* wizard_controller = |
1289 chromeos::WizardController::default_controller(); | 1288 chromeos::WizardController::default_controller(); |
1290 ASSERT_TRUE(wizard_controller); | 1289 ASSERT_TRUE(wizard_controller); |
1291 wizard_controller->AdvanceToScreen(WizardController::kNetworkScreenName); | 1290 wizard_controller->AdvanceToScreen(WizardController::kNetworkScreenName); |
1292 ReloadAutolaunchKioskApps(); | 1291 ReloadAutolaunchKioskApps(); |
1293 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); | 1292 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); |
1294 content::WindowedNotificationObserver( | 1293 content::WindowedNotificationObserver( |
1295 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1294 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
1296 content::NotificationService::AllSources()).Wait(); | 1295 content::NotificationService::AllSources()).Wait(); |
1297 GetLoginUI()->CallJavascriptFunction( | 1296 GetLoginUI()->CallJavascriptFunctionUnsafe( |
1298 "login.AutolaunchScreen.confirmAutoLaunchForTesting", | 1297 "login.AutolaunchScreen.confirmAutoLaunchForTesting", |
1299 base::FundamentalValue(true)); | 1298 base::FundamentalValue(true)); |
1300 | 1299 |
1301 // Make cros settings untrusted. | 1300 // Make cros settings untrusted. |
1302 settings_helper_.SetTrustedStatus( | 1301 settings_helper_.SetTrustedStatus( |
1303 CrosSettingsProvider::PERMANENTLY_UNTRUSTED); | 1302 CrosSettingsProvider::PERMANENTLY_UNTRUSTED); |
1304 | 1303 |
1305 // Check that the attempt to auto-launch a kiosk app fails with an error. | 1304 // Check that the attempt to auto-launch a kiosk app fails with an error. |
1306 OobeScreenWaiter(OobeScreen::SCREEN_ERROR_MESSAGE).Wait(); | 1305 OobeScreenWaiter(OobeScreen::SCREEN_ERROR_MESSAGE).Wait(); |
1307 } | 1306 } |
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2403 content::WindowedNotificationObserver( | 2402 content::WindowedNotificationObserver( |
2404 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 2403 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
2405 content::NotificationService::AllSources()).Wait(); | 2404 content::NotificationService::AllSources()).Wait(); |
2406 | 2405 |
2407 // Wait for the wallpaper to load. | 2406 // Wait for the wallpaper to load. |
2408 WaitForWallpaper(); | 2407 WaitForWallpaper(); |
2409 EXPECT_TRUE(wallpaper_loaded()); | 2408 EXPECT_TRUE(wallpaper_loaded()); |
2410 } | 2409 } |
2411 | 2410 |
2412 } // namespace chromeos | 2411 } // namespace chromeos |
OLD | NEW |