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 22 matching lines...) Expand all Loading... |
33 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" | 33 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" |
34 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" | 34 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
35 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 35 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
36 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h" | 36 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h" |
37 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h
" | 37 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h
" |
38 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 38 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
39 #include "chrome/browser/extensions/extension_service.h" | 39 #include "chrome/browser/extensions/extension_service.h" |
40 #include "chrome/browser/profiles/profile_impl.h" | 40 #include "chrome/browser/profiles/profile_impl.h" |
41 #include "chrome/browser/profiles/profile_manager.h" | 41 #include "chrome/browser/profiles/profile_manager.h" |
42 #include "chrome/browser/profiles/profiles_state.h" | 42 #include "chrome/browser/profiles/profiles_state.h" |
| 43 #include "chrome/browser/signin/signin_manager_factory.h" |
43 #include "chrome/browser/ui/webui/chromeos/login/kiosk_app_menu_handler.h" | 44 #include "chrome/browser/ui/webui/chromeos/login/kiosk_app_menu_handler.h" |
44 #include "chrome/common/chrome_constants.h" | 45 #include "chrome/common/chrome_constants.h" |
45 #include "chrome/common/chrome_paths.h" | 46 #include "chrome/common/chrome_paths.h" |
46 #include "chrome/common/pref_names.h" | 47 #include "chrome/common/pref_names.h" |
47 #include "chromeos/chromeos_switches.h" | 48 #include "chromeos/chromeos_switches.h" |
48 #include "chromeos/dbus/cryptohome_client.h" | 49 #include "chromeos/dbus/cryptohome_client.h" |
49 #include "chromeos/disks/disk_mount_manager.h" | 50 #include "chromeos/disks/disk_mount_manager.h" |
50 #include "chromeos/system/fake_statistics_provider.h" | 51 #include "chromeos/system/fake_statistics_provider.h" |
51 #include "chromeos/system/statistics_provider.h" | 52 #include "chromeos/system/statistics_provider.h" |
52 #include "components/signin/core/common/signin_pref_names.h" | 53 #include "components/signin/core/browser/signin_manager.h" |
53 #include "content/public/browser/browser_thread.h" | 54 #include "content/public/browser/browser_thread.h" |
54 #include "content/public/browser/notification_observer.h" | 55 #include "content/public/browser/notification_observer.h" |
55 #include "content/public/browser/notification_registrar.h" | 56 #include "content/public/browser/notification_registrar.h" |
56 #include "content/public/browser/notification_service.h" | 57 #include "content/public/browser/notification_service.h" |
57 #include "content/public/browser/web_ui.h" | 58 #include "content/public/browser/web_ui.h" |
58 #include "content/public/test/browser_test_utils.h" | 59 #include "content/public/test/browser_test_utils.h" |
59 #include "extensions/browser/app_window/app_window.h" | 60 #include "extensions/browser/app_window/app_window.h" |
60 #include "extensions/browser/app_window/app_window_registry.h" | 61 #include "extensions/browser/app_window/app_window_registry.h" |
61 #include "extensions/browser/app_window/native_app_window.h" | 62 #include "extensions/browser/app_window/native_app_window.h" |
62 #include "extensions/browser/extension_system.h" | 63 #include "extensions/browser/extension_system.h" |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 } | 707 } |
707 | 708 |
708 IN_PROC_BROWSER_TEST_F(KioskTest, NotSignedInWithGAIAAccount) { | 709 IN_PROC_BROWSER_TEST_F(KioskTest, NotSignedInWithGAIAAccount) { |
709 // Tests that the kiosk session is not considered to be logged in with a GAIA | 710 // Tests that the kiosk session is not considered to be logged in with a GAIA |
710 // account. | 711 // account. |
711 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); | 712 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); |
712 WaitForAppLaunchSuccess(); | 713 WaitForAppLaunchSuccess(); |
713 | 714 |
714 Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); | 715 Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); |
715 ASSERT_TRUE(app_profile); | 716 ASSERT_TRUE(app_profile); |
716 EXPECT_FALSE(app_profile->GetPrefs()->HasPrefPath( | 717 EXPECT_FALSE( |
717 prefs::kGoogleServicesUsername)); | 718 SigninManagerFactory::GetForProfile(app_profile)->IsAuthenticated()); |
718 } | 719 } |
719 | 720 |
720 IN_PROC_BROWSER_TEST_F(KioskTest, PRE_LaunchAppNetworkDown) { | 721 IN_PROC_BROWSER_TEST_F(KioskTest, PRE_LaunchAppNetworkDown) { |
721 // Tests the network down case for the initial app download and launch. | 722 // Tests the network down case for the initial app download and launch. |
722 RunAppLaunchNetworkDownTest(); | 723 RunAppLaunchNetworkDownTest(); |
723 } | 724 } |
724 | 725 |
725 IN_PROC_BROWSER_TEST_F(KioskTest, LaunchAppNetworkDown) { | 726 IN_PROC_BROWSER_TEST_F(KioskTest, LaunchAppNetworkDown) { |
726 // Tests the network down case for launching an existing app that is | 727 // Tests the network down case for launching an existing app that is |
727 // installed in PRE_LaunchAppNetworkDown. | 728 // installed in PRE_LaunchAppNetworkDown. |
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1756 " window.domAutomationController.setAutomationId(0);" | 1757 " window.domAutomationController.setAutomationId(0);" |
1757 " window.domAutomationController.send(token);" | 1758 " window.domAutomationController.send(token);" |
1758 "});", | 1759 "});", |
1759 &result)); | 1760 &result)); |
1760 EXPECT_EQ(kTestAccessToken, result); | 1761 EXPECT_EQ(kTestAccessToken, result); |
1761 | 1762 |
1762 // Verify that the session is not considered to be logged in with a GAIA | 1763 // Verify that the session is not considered to be logged in with a GAIA |
1763 // account. | 1764 // account. |
1764 Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); | 1765 Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); |
1765 ASSERT_TRUE(app_profile); | 1766 ASSERT_TRUE(app_profile); |
1766 EXPECT_FALSE(app_profile->GetPrefs()->HasPrefPath( | 1767 EXPECT_FALSE( |
1767 prefs::kGoogleServicesUsername)); | 1768 SigninManagerFactory::GetForProfile(app_profile)->IsAuthenticated()); |
1768 | 1769 |
1769 // Terminate the app. | 1770 // Terminate the app. |
1770 window->GetBaseWindow()->Close(); | 1771 window->GetBaseWindow()->Close(); |
1771 content::RunAllPendingInMessageLoop(); | 1772 content::RunAllPendingInMessageLoop(); |
1772 } | 1773 } |
1773 | 1774 |
1774 IN_PROC_BROWSER_TEST_F(KioskEnterpriseTest, PrivateStore) { | 1775 IN_PROC_BROWSER_TEST_F(KioskEnterpriseTest, PrivateStore) { |
1775 set_test_app_id(kTestEnterpriseKioskApp); | 1776 set_test_app_id(kTestEnterpriseKioskApp); |
1776 | 1777 |
1777 const char kPrivateStoreUpdate[] = "/private_store_update"; | 1778 const char kPrivateStoreUpdate[] = "/private_store_update"; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1877 content::WindowedNotificationObserver( | 1878 content::WindowedNotificationObserver( |
1878 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1879 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
1879 content::NotificationService::AllSources()).Wait(); | 1880 content::NotificationService::AllSources()).Wait(); |
1880 | 1881 |
1881 // Wait for the wallpaper to load. | 1882 // Wait for the wallpaper to load. |
1882 WaitForWallpaper(); | 1883 WaitForWallpaper(); |
1883 EXPECT_TRUE(wallpaper_loaded()); | 1884 EXPECT_TRUE(wallpaper_loaded()); |
1884 } | 1885 } |
1885 | 1886 |
1886 } // namespace chromeos | 1887 } // namespace chromeos |
OLD | NEW |