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 "apps/test/app_window_waiter.h" | 8 #include "apps/test/app_window_waiter.h" |
9 #include "ash/common/wallpaper/wallpaper_controller.h" | 9 #include "ash/common/wallpaper/wallpaper_controller.h" |
10 #include "ash/common/wallpaper/wallpaper_controller_observer.h" | 10 #include "ash/common/wallpaper/wallpaper_controller_observer.h" |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 IN_PROC_BROWSER_TEST_F(KioskTest, AutolaunchWarningCancel) { | 1062 IN_PROC_BROWSER_TEST_F(KioskTest, AutolaunchWarningCancel) { |
1063 EnableConsumerKioskMode(); | 1063 EnableConsumerKioskMode(); |
1064 | 1064 |
1065 chromeos::WizardController::SkipPostLoginScreensForTesting(); | 1065 chromeos::WizardController::SkipPostLoginScreensForTesting(); |
1066 chromeos::WizardController* wizard_controller = | 1066 chromeos::WizardController* wizard_controller = |
1067 chromeos::WizardController::default_controller(); | 1067 chromeos::WizardController::default_controller(); |
1068 CHECK(wizard_controller); | 1068 CHECK(wizard_controller); |
1069 | 1069 |
1070 // Start login screen after configuring auto launch app since the warning | 1070 // Start login screen after configuring auto launch app since the warning |
1071 // is triggered when switching to login screen. | 1071 // is triggered when switching to login screen. |
1072 wizard_controller->AdvanceToScreen(WizardController::kNetworkScreenName); | 1072 wizard_controller->AdvanceToScreen(OobeScreen::SCREEN_OOBE_NETWORK); |
1073 ReloadAutolaunchKioskApps(); | 1073 ReloadAutolaunchKioskApps(); |
1074 EXPECT_FALSE(KioskAppManager::Get()->GetAutoLaunchApp().empty()); | 1074 EXPECT_FALSE(KioskAppManager::Get()->GetAutoLaunchApp().empty()); |
1075 EXPECT_FALSE(KioskAppManager::Get()->IsAutoLaunchEnabled()); | 1075 EXPECT_FALSE(KioskAppManager::Get()->IsAutoLaunchEnabled()); |
1076 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); | 1076 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); |
1077 | 1077 |
1078 // Wait for the auto launch warning come up. | 1078 // Wait for the auto launch warning come up. |
1079 content::WindowedNotificationObserver( | 1079 content::WindowedNotificationObserver( |
1080 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1080 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
1081 content::NotificationService::AllSources()).Wait(); | 1081 content::NotificationService::AllSources()).Wait(); |
1082 GetLoginUI()->CallJavascriptFunctionUnsafe( | 1082 GetLoginUI()->CallJavascriptFunctionUnsafe( |
(...skipping 11 matching lines...) Expand all Loading... |
1094 IN_PROC_BROWSER_TEST_F(KioskTest, AutolaunchWarningConfirm) { | 1094 IN_PROC_BROWSER_TEST_F(KioskTest, AutolaunchWarningConfirm) { |
1095 EnableConsumerKioskMode(); | 1095 EnableConsumerKioskMode(); |
1096 | 1096 |
1097 chromeos::WizardController::SkipPostLoginScreensForTesting(); | 1097 chromeos::WizardController::SkipPostLoginScreensForTesting(); |
1098 chromeos::WizardController* wizard_controller = | 1098 chromeos::WizardController* wizard_controller = |
1099 chromeos::WizardController::default_controller(); | 1099 chromeos::WizardController::default_controller(); |
1100 CHECK(wizard_controller); | 1100 CHECK(wizard_controller); |
1101 | 1101 |
1102 // Start login screen after configuring auto launch app since the warning | 1102 // Start login screen after configuring auto launch app since the warning |
1103 // is triggered when switching to login screen. | 1103 // is triggered when switching to login screen. |
1104 wizard_controller->AdvanceToScreen(WizardController::kNetworkScreenName); | 1104 wizard_controller->AdvanceToScreen(OobeScreen::SCREEN_OOBE_NETWORK); |
1105 ReloadAutolaunchKioskApps(); | 1105 ReloadAutolaunchKioskApps(); |
1106 EXPECT_FALSE(KioskAppManager::Get()->GetAutoLaunchApp().empty()); | 1106 EXPECT_FALSE(KioskAppManager::Get()->GetAutoLaunchApp().empty()); |
1107 EXPECT_FALSE(KioskAppManager::Get()->IsAutoLaunchEnabled()); | 1107 EXPECT_FALSE(KioskAppManager::Get()->IsAutoLaunchEnabled()); |
1108 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); | 1108 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); |
1109 | 1109 |
1110 // Wait for the auto launch warning come up. | 1110 // Wait for the auto launch warning come up. |
1111 content::WindowedNotificationObserver( | 1111 content::WindowedNotificationObserver( |
1112 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1112 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
1113 content::NotificationService::AllSources()).Wait(); | 1113 content::NotificationService::AllSources()).Wait(); |
1114 GetLoginUI()->CallJavascriptFunctionUnsafe( | 1114 GetLoginUI()->CallJavascriptFunctionUnsafe( |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1268 // Verifies that a consumer device does not auto-launch kiosk mode when cros | 1268 // Verifies that a consumer device does not auto-launch kiosk mode when cros |
1269 // settings are untrusted. | 1269 // settings are untrusted. |
1270 IN_PROC_BROWSER_TEST_F(KioskTest, NoConsumerAutoLaunchWhenUntrusted) { | 1270 IN_PROC_BROWSER_TEST_F(KioskTest, NoConsumerAutoLaunchWhenUntrusted) { |
1271 EnableConsumerKioskMode(); | 1271 EnableConsumerKioskMode(); |
1272 | 1272 |
1273 // Wait for and confirm the auto-launch warning. | 1273 // Wait for and confirm the auto-launch warning. |
1274 chromeos::WizardController::SkipPostLoginScreensForTesting(); | 1274 chromeos::WizardController::SkipPostLoginScreensForTesting(); |
1275 chromeos::WizardController* wizard_controller = | 1275 chromeos::WizardController* wizard_controller = |
1276 chromeos::WizardController::default_controller(); | 1276 chromeos::WizardController::default_controller(); |
1277 ASSERT_TRUE(wizard_controller); | 1277 ASSERT_TRUE(wizard_controller); |
1278 wizard_controller->AdvanceToScreen(WizardController::kNetworkScreenName); | 1278 wizard_controller->AdvanceToScreen(OobeScreen::SCREEN_OOBE_NETWORK); |
1279 ReloadAutolaunchKioskApps(); | 1279 ReloadAutolaunchKioskApps(); |
1280 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); | 1280 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); |
1281 content::WindowedNotificationObserver( | 1281 content::WindowedNotificationObserver( |
1282 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1282 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
1283 content::NotificationService::AllSources()).Wait(); | 1283 content::NotificationService::AllSources()).Wait(); |
1284 GetLoginUI()->CallJavascriptFunctionUnsafe( | 1284 GetLoginUI()->CallJavascriptFunctionUnsafe( |
1285 "login.AutolaunchScreen.confirmAutoLaunchForTesting", | 1285 "login.AutolaunchScreen.confirmAutoLaunchForTesting", |
1286 base::FundamentalValue(true)); | 1286 base::FundamentalValue(true)); |
1287 | 1287 |
1288 // Make cros settings untrusted. | 1288 // Make cros settings untrusted. |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2373 ScopedUserManagerEnabler enabler(user_manager); | 2373 ScopedUserManagerEnabler enabler(user_manager); |
2374 | 2374 |
2375 // Set kiosk app to autolaunch. | 2375 // Set kiosk app to autolaunch. |
2376 EnableConsumerKioskMode(); | 2376 EnableConsumerKioskMode(); |
2377 WizardController::SkipPostLoginScreensForTesting(); | 2377 WizardController::SkipPostLoginScreensForTesting(); |
2378 WizardController* wizard_controller = WizardController::default_controller(); | 2378 WizardController* wizard_controller = WizardController::default_controller(); |
2379 CHECK(wizard_controller); | 2379 CHECK(wizard_controller); |
2380 | 2380 |
2381 // Start login screen after configuring auto launch app since the warning | 2381 // Start login screen after configuring auto launch app since the warning |
2382 // is triggered when switching to login screen. | 2382 // is triggered when switching to login screen. |
2383 wizard_controller->AdvanceToScreen(WizardController::kNetworkScreenName); | 2383 wizard_controller->AdvanceToScreen(OobeScreen::SCREEN_OOBE_NETWORK); |
2384 ReloadAutolaunchKioskApps(); | 2384 ReloadAutolaunchKioskApps(); |
2385 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); | 2385 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); |
2386 | 2386 |
2387 EXPECT_FALSE(KioskAppManager::Get()->GetAutoLaunchApp().empty()); | 2387 EXPECT_FALSE(KioskAppManager::Get()->GetAutoLaunchApp().empty()); |
2388 EXPECT_FALSE(KioskAppManager::Get()->IsAutoLaunchEnabled()); | 2388 EXPECT_FALSE(KioskAppManager::Get()->IsAutoLaunchEnabled()); |
2389 | 2389 |
2390 // Wait for the auto launch warning come up. | 2390 // Wait for the auto launch warning come up. |
2391 content::WindowedNotificationObserver( | 2391 content::WindowedNotificationObserver( |
2392 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 2392 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
2393 content::NotificationService::AllSources()).Wait(); | 2393 content::NotificationService::AllSources()).Wait(); |
2394 | 2394 |
2395 // Wait for the wallpaper to load. | 2395 // Wait for the wallpaper to load. |
2396 WaitForWallpaper(); | 2396 WaitForWallpaper(); |
2397 EXPECT_TRUE(wallpaper_loaded()); | 2397 EXPECT_TRUE(wallpaper_loaded()); |
2398 } | 2398 } |
2399 | 2399 |
2400 } // namespace chromeos | 2400 } // namespace chromeos |
OLD | NEW |