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" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
18 #include "chrome/browser/chrome_notification_types.h" | 18 #include "chrome/browser/chrome_notification_types.h" |
19 #include "chrome/browser/chromeos/app_mode/fake_cws.h" | 19 #include "chrome/browser/chromeos/app_mode/fake_cws.h" |
20 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" | 20 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" |
21 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 21 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
22 #include "chrome/browser/chromeos/file_manager/fake_disk_mount_manager.h" | 22 #include "chrome/browser/chromeos/file_manager/fake_disk_mount_manager.h" |
23 #include "chrome/browser/chromeos/login/app_launch_controller.h" | 23 #include "chrome/browser/chromeos/login/app_launch_controller.h" |
24 #include "chrome/browser/chromeos/login/startup_utils.h" | 24 #include "chrome/browser/chromeos/login/startup_utils.h" |
25 #include "chrome/browser/chromeos/login/test/app_window_waiter.h" | 25 #include "chrome/browser/chromeos/login/test/app_window_waiter.h" |
26 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" | 26 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" |
27 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" | 27 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" |
28 #include "chrome/browser/chromeos/login/users/fake_user_manager.h" | 28 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" |
29 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" | 29 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" |
30 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 30 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
31 #include "chrome/browser/chromeos/login/wizard_controller.h" | 31 #include "chrome/browser/chromeos/login/wizard_controller.h" |
32 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" | 32 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" |
33 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" | 33 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
34 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 34 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
35 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h" | 35 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h" |
36 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h
" | 36 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h
" |
37 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 37 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
38 #include "chrome/browser/extensions/extension_service.h" | 38 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1803 } | 1803 } |
1804 | 1804 |
1805 bool wallpaper_loaded_; | 1805 bool wallpaper_loaded_; |
1806 scoped_refptr<content::MessageLoopRunner> runner_; | 1806 scoped_refptr<content::MessageLoopRunner> runner_; |
1807 | 1807 |
1808 DISALLOW_COPY_AND_ASSIGN(KioskHiddenWebUITest); | 1808 DISALLOW_COPY_AND_ASSIGN(KioskHiddenWebUITest); |
1809 }; | 1809 }; |
1810 | 1810 |
1811 IN_PROC_BROWSER_TEST_F(KioskHiddenWebUITest, AutolaunchWarning) { | 1811 IN_PROC_BROWSER_TEST_F(KioskHiddenWebUITest, AutolaunchWarning) { |
1812 // Add a device owner. | 1812 // Add a device owner. |
1813 FakeUserManager* user_manager = new FakeUserManager(); | 1813 FakeChromeUserManager* user_manager = new FakeChromeUserManager(); |
1814 user_manager->AddUser(kTestOwnerEmail); | 1814 user_manager->AddUser(kTestOwnerEmail); |
1815 ScopedUserManagerEnabler enabler(user_manager); | 1815 ScopedUserManagerEnabler enabler(user_manager); |
1816 | 1816 |
1817 // Set kiosk app to autolaunch. | 1817 // Set kiosk app to autolaunch. |
1818 EnableConsumerKioskMode(); | 1818 EnableConsumerKioskMode(); |
1819 chromeos::WizardController::SkipPostLoginScreensForTesting(); | 1819 WizardController::SkipPostLoginScreensForTesting(); |
1820 chromeos::WizardController* wizard_controller = | 1820 WizardController* wizard_controller = WizardController::default_controller(); |
1821 chromeos::WizardController::default_controller(); | |
1822 CHECK(wizard_controller); | 1821 CHECK(wizard_controller); |
1823 | 1822 |
1824 // Start login screen after configuring auto launch app since the warning | 1823 // Start login screen after configuring auto launch app since the warning |
1825 // is triggered when switching to login screen. | 1824 // is triggered when switching to login screen. |
1826 wizard_controller->AdvanceToScreen(WizardController::kNetworkScreenName); | 1825 wizard_controller->AdvanceToScreen(WizardController::kNetworkScreenName); |
1827 ReloadAutolaunchKioskApps(); | 1826 ReloadAutolaunchKioskApps(); |
1828 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); | 1827 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); |
1829 | 1828 |
1830 EXPECT_FALSE(KioskAppManager::Get()->GetAutoLaunchApp().empty()); | 1829 EXPECT_FALSE(KioskAppManager::Get()->GetAutoLaunchApp().empty()); |
1831 EXPECT_FALSE(KioskAppManager::Get()->IsAutoLaunchEnabled()); | 1830 EXPECT_FALSE(KioskAppManager::Get()->IsAutoLaunchEnabled()); |
1832 | 1831 |
1833 // Wait for the auto launch warning come up. | 1832 // Wait for the auto launch warning come up. |
1834 content::WindowedNotificationObserver( | 1833 content::WindowedNotificationObserver( |
1835 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1834 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
1836 content::NotificationService::AllSources()).Wait(); | 1835 content::NotificationService::AllSources()).Wait(); |
1837 | 1836 |
1838 // Wait for the wallpaper to load. | 1837 // Wait for the wallpaper to load. |
1839 WaitForWallpaper(); | 1838 WaitForWallpaper(); |
1840 EXPECT_TRUE(wallpaper_loaded()); | 1839 EXPECT_TRUE(wallpaper_loaded()); |
1841 } | 1840 } |
1842 | 1841 |
1843 } // namespace chromeos | 1842 } // namespace chromeos |
OLD | NEW |