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 "ash/desktop_background/desktop_background_controller.h" | 5 #include "ash/desktop_background/desktop_background_controller.h" |
6 #include "ash/desktop_background/desktop_background_controller_observer.h" | 6 #include "ash/desktop_background/desktop_background_controller_observer.h" |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 std::string test_crx_file_; | 800 std::string test_crx_file_; |
801 scoped_ptr<FakeCWS> fake_cws_; | 801 scoped_ptr<FakeCWS> fake_cws_; |
802 scoped_ptr<MockUserManager> mock_user_manager_; | 802 scoped_ptr<MockUserManager> mock_user_manager_; |
803 | 803 |
804 DISALLOW_COPY_AND_ASSIGN(KioskTest); | 804 DISALLOW_COPY_AND_ASSIGN(KioskTest); |
805 }; | 805 }; |
806 | 806 |
807 IN_PROC_BROWSER_TEST_F(KioskTest, InstallAndLaunchApp) { | 807 IN_PROC_BROWSER_TEST_F(KioskTest, InstallAndLaunchApp) { |
808 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); | 808 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); |
809 WaitForAppLaunchSuccess(); | 809 WaitForAppLaunchSuccess(); |
| 810 KioskAppManager::App app; |
| 811 ASSERT_TRUE(KioskAppManager::Get()->GetApp(test_app_id(), &app)); |
| 812 EXPECT_FALSE(app.was_auto_launched_with_zero_delay); |
810 } | 813 } |
811 | 814 |
812 IN_PROC_BROWSER_TEST_F(KioskTest, ZoomSupport) { | 815 IN_PROC_BROWSER_TEST_F(KioskTest, ZoomSupport) { |
813 ExtensionTestMessageListener | 816 ExtensionTestMessageListener |
814 app_window_loaded_listener("appWindowLoaded", false); | 817 app_window_loaded_listener("appWindowLoaded", false); |
815 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); | 818 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); |
816 app_window_loaded_listener.WaitUntilSatisfied(); | 819 app_window_loaded_listener.WaitUntilSatisfied(); |
817 | 820 |
818 Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); | 821 Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); |
819 ASSERT_TRUE(app_profile); | 822 ASSERT_TRUE(app_profile); |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 | 1078 |
1076 // Wait for the auto launch warning to go away. | 1079 // Wait for the auto launch warning to go away. |
1077 content::WindowedNotificationObserver( | 1080 content::WindowedNotificationObserver( |
1078 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_COMPLETED, | 1081 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_COMPLETED, |
1079 content::NotificationService::AllSources()).Wait(); | 1082 content::NotificationService::AllSources()).Wait(); |
1080 | 1083 |
1081 EXPECT_FALSE(KioskAppManager::Get()->GetAutoLaunchApp().empty()); | 1084 EXPECT_FALSE(KioskAppManager::Get()->GetAutoLaunchApp().empty()); |
1082 EXPECT_TRUE(KioskAppManager::Get()->IsAutoLaunchEnabled()); | 1085 EXPECT_TRUE(KioskAppManager::Get()->IsAutoLaunchEnabled()); |
1083 | 1086 |
1084 WaitForAppLaunchSuccess(); | 1087 WaitForAppLaunchSuccess(); |
| 1088 |
| 1089 KioskAppManager::App app; |
| 1090 ASSERT_TRUE(KioskAppManager::Get()->GetApp(test_app_id(), &app)); |
| 1091 EXPECT_TRUE(app.was_auto_launched_with_zero_delay); |
1085 } | 1092 } |
1086 | 1093 |
1087 IN_PROC_BROWSER_TEST_F(KioskTest, KioskEnableCancel) { | 1094 IN_PROC_BROWSER_TEST_F(KioskTest, KioskEnableCancel) { |
1088 chromeos::WizardController::SkipPostLoginScreensForTesting(); | 1095 chromeos::WizardController::SkipPostLoginScreensForTesting(); |
1089 chromeos::WizardController* wizard_controller = | 1096 chromeos::WizardController* wizard_controller = |
1090 chromeos::WizardController::default_controller(); | 1097 chromeos::WizardController::default_controller(); |
1091 CHECK(wizard_controller); | 1098 CHECK(wizard_controller); |
1092 | 1099 |
1093 // Check Kiosk mode status. | 1100 // Check Kiosk mode status. |
1094 EXPECT_EQ(KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_CONFIGURABLE, | 1101 EXPECT_EQ(KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_CONFIGURABLE, |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 // settings are untrusted. | 1256 // settings are untrusted. |
1250 IN_PROC_BROWSER_TEST_F(KioskTest, NoEnterpriseAutoLaunchWhenUntrusted) { | 1257 IN_PROC_BROWSER_TEST_F(KioskTest, NoEnterpriseAutoLaunchWhenUntrusted) { |
1251 PrepareAppLaunch(); | 1258 PrepareAppLaunch(); |
1252 SimulateNetworkOnline(); | 1259 SimulateNetworkOnline(); |
1253 | 1260 |
1254 // Make cros settings untrusted. | 1261 // Make cros settings untrusted. |
1255 CrosSettingsPermanentlyUntrustedMaker(); | 1262 CrosSettingsPermanentlyUntrustedMaker(); |
1256 | 1263 |
1257 // Trigger the code that handles auto-launch on enterprise devices. This would | 1264 // Trigger the code that handles auto-launch on enterprise devices. This would |
1258 // normally be called from ShowLoginWizard(), which runs so early that it is | 1265 // normally be called from ShowLoginWizard(), which runs so early that it is |
1259 // not to inject an auto-launch policy before it runs. | 1266 // not possible to inject an auto-launch policy before it runs. |
1260 LoginDisplayHost* login_display_host = LoginDisplayHostImpl::default_host(); | 1267 LoginDisplayHost* login_display_host = LoginDisplayHostImpl::default_host(); |
1261 ASSERT_TRUE(login_display_host); | 1268 ASSERT_TRUE(login_display_host); |
1262 login_display_host->StartAppLaunch(test_app_id(), false); | 1269 login_display_host->StartAppLaunch(test_app_id(), false, true); |
1263 | 1270 |
1264 // Check that no launch has started. | 1271 // Check that no launch has started. |
1265 EXPECT_FALSE(login_display_host->GetAppLaunchController()); | 1272 EXPECT_FALSE(login_display_host->GetAppLaunchController()); |
1266 } | 1273 } |
1267 | 1274 |
1268 class KioskUpdateTest : public KioskTest { | 1275 class KioskUpdateTest : public KioskTest { |
1269 public: | 1276 public: |
1270 KioskUpdateTest() {} | 1277 KioskUpdateTest() {} |
1271 ~KioskUpdateTest() override {} | 1278 ~KioskUpdateTest() override {} |
1272 | 1279 |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1975 content::WindowedNotificationObserver( | 1982 content::WindowedNotificationObserver( |
1976 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1983 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
1977 content::NotificationService::AllSources()).Wait(); | 1984 content::NotificationService::AllSources()).Wait(); |
1978 | 1985 |
1979 // Wait for the wallpaper to load. | 1986 // Wait for the wallpaper to load. |
1980 WaitForWallpaper(); | 1987 WaitForWallpaper(); |
1981 EXPECT_TRUE(wallpaper_loaded()); | 1988 EXPECT_TRUE(wallpaper_loaded()); |
1982 } | 1989 } |
1983 | 1990 |
1984 } // namespace chromeos | 1991 } // namespace chromeos |
OLD | NEW |