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 21 matching lines...) Expand all Loading... |
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" |
39 #include "chrome/browser/profiles/profile_impl.h" | 39 #include "chrome/browser/profiles/profile_impl.h" |
40 #include "chrome/browser/profiles/profile_manager.h" | 40 #include "chrome/browser/profiles/profile_manager.h" |
41 #include "chrome/browser/profiles/profiles_state.h" | 41 #include "chrome/browser/profiles/profiles_state.h" |
| 42 #include "chrome/browser/signin/signin_manager_factory.h" |
42 #include "chrome/browser/ui/webui/chromeos/login/kiosk_app_menu_handler.h" | 43 #include "chrome/browser/ui/webui/chromeos/login/kiosk_app_menu_handler.h" |
43 #include "chrome/common/chrome_constants.h" | 44 #include "chrome/common/chrome_constants.h" |
44 #include "chrome/common/chrome_paths.h" | 45 #include "chrome/common/chrome_paths.h" |
45 #include "chrome/common/pref_names.h" | 46 #include "chrome/common/pref_names.h" |
46 #include "chromeos/chromeos_switches.h" | 47 #include "chromeos/chromeos_switches.h" |
47 #include "chromeos/dbus/cryptohome_client.h" | 48 #include "chromeos/dbus/cryptohome_client.h" |
48 #include "chromeos/disks/disk_mount_manager.h" | 49 #include "chromeos/disks/disk_mount_manager.h" |
| 50 #include "components/signin/core/browser/signin_manager.h" |
49 #include "components/signin/core/common/signin_pref_names.h" | 51 #include "components/signin/core/common/signin_pref_names.h" |
50 #include "content/public/browser/browser_thread.h" | 52 #include "content/public/browser/browser_thread.h" |
51 #include "content/public/browser/notification_observer.h" | 53 #include "content/public/browser/notification_observer.h" |
52 #include "content/public/browser/notification_registrar.h" | 54 #include "content/public/browser/notification_registrar.h" |
53 #include "content/public/browser/notification_service.h" | 55 #include "content/public/browser/notification_service.h" |
54 #include "content/public/browser/web_ui.h" | 56 #include "content/public/browser/web_ui.h" |
55 #include "content/public/test/browser_test_utils.h" | 57 #include "content/public/test/browser_test_utils.h" |
56 #include "extensions/browser/app_window/app_window.h" | 58 #include "extensions/browser/app_window/app_window.h" |
57 #include "extensions/browser/app_window/app_window_registry.h" | 59 #include "extensions/browser/app_window/app_window_registry.h" |
58 #include "extensions/browser/app_window/native_app_window.h" | 60 #include "extensions/browser/app_window/native_app_window.h" |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 } | 705 } |
704 | 706 |
705 IN_PROC_BROWSER_TEST_F(KioskTest, NotSignedInWithGAIAAccount) { | 707 IN_PROC_BROWSER_TEST_F(KioskTest, NotSignedInWithGAIAAccount) { |
706 // Tests that the kiosk session is not considered to be logged in with a GAIA | 708 // Tests that the kiosk session is not considered to be logged in with a GAIA |
707 // account. | 709 // account. |
708 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); | 710 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); |
709 WaitForAppLaunchSuccess(); | 711 WaitForAppLaunchSuccess(); |
710 | 712 |
711 Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); | 713 Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); |
712 ASSERT_TRUE(app_profile); | 714 ASSERT_TRUE(app_profile); |
713 EXPECT_FALSE(app_profile->GetPrefs()->HasPrefPath( | 715 EXPECT_FALSE( |
714 prefs::kGoogleServicesUsername)); | 716 SigninManagerFactory::GetForProfile(app_profile)->IsAuthenticated()); |
715 } | 717 } |
716 | 718 |
717 IN_PROC_BROWSER_TEST_F(KioskTest, PRE_LaunchAppNetworkDown) { | 719 IN_PROC_BROWSER_TEST_F(KioskTest, PRE_LaunchAppNetworkDown) { |
718 // Tests the network down case for the initial app download and launch. | 720 // Tests the network down case for the initial app download and launch. |
719 RunAppLaunchNetworkDownTest(); | 721 RunAppLaunchNetworkDownTest(); |
720 } | 722 } |
721 | 723 |
722 IN_PROC_BROWSER_TEST_F(KioskTest, LaunchAppNetworkDown) { | 724 IN_PROC_BROWSER_TEST_F(KioskTest, LaunchAppNetworkDown) { |
723 // Tests the network down case for launching an existing app that is | 725 // Tests the network down case for launching an existing app that is |
724 // installed in PRE_LaunchAppNetworkDown. | 726 // installed in PRE_LaunchAppNetworkDown. |
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1716 " window.domAutomationController.setAutomationId(0);" | 1718 " window.domAutomationController.setAutomationId(0);" |
1717 " window.domAutomationController.send(token);" | 1719 " window.domAutomationController.send(token);" |
1718 "});", | 1720 "});", |
1719 &result)); | 1721 &result)); |
1720 EXPECT_EQ(kTestAccessToken, result); | 1722 EXPECT_EQ(kTestAccessToken, result); |
1721 | 1723 |
1722 // Verify that the session is not considered to be logged in with a GAIA | 1724 // Verify that the session is not considered to be logged in with a GAIA |
1723 // account. | 1725 // account. |
1724 Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); | 1726 Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); |
1725 ASSERT_TRUE(app_profile); | 1727 ASSERT_TRUE(app_profile); |
1726 EXPECT_FALSE(app_profile->GetPrefs()->HasPrefPath( | 1728 EXPECT_FALSE( |
1727 prefs::kGoogleServicesUsername)); | 1729 SigninManagerFactory::GetForProfile(app_profile)->IsAuthenticated()); |
1728 | 1730 |
1729 // Terminate the app. | 1731 // Terminate the app. |
1730 window->GetBaseWindow()->Close(); | 1732 window->GetBaseWindow()->Close(); |
1731 content::RunAllPendingInMessageLoop(); | 1733 content::RunAllPendingInMessageLoop(); |
1732 } | 1734 } |
1733 | 1735 |
1734 IN_PROC_BROWSER_TEST_F(KioskEnterpriseTest, PrivateStore) { | 1736 IN_PROC_BROWSER_TEST_F(KioskEnterpriseTest, PrivateStore) { |
1735 set_test_app_id(kTestEnterpriseKioskApp); | 1737 set_test_app_id(kTestEnterpriseKioskApp); |
1736 | 1738 |
1737 const char kPrivateStoreUpdate[] = "/private_store_update"; | 1739 const char kPrivateStoreUpdate[] = "/private_store_update"; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1837 content::WindowedNotificationObserver( | 1839 content::WindowedNotificationObserver( |
1838 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1840 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
1839 content::NotificationService::AllSources()).Wait(); | 1841 content::NotificationService::AllSources()).Wait(); |
1840 | 1842 |
1841 // Wait for the wallpaper to load. | 1843 // Wait for the wallpaper to load. |
1842 WaitForWallpaper(); | 1844 WaitForWallpaper(); |
1843 EXPECT_TRUE(wallpaper_loaded()); | 1845 EXPECT_TRUE(wallpaper_loaded()); |
1844 } | 1846 } |
1845 | 1847 |
1846 } // namespace chromeos | 1848 } // namespace chromeos |
OLD | NEW |