| 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 "apps/app_window.h" | 5 #include "apps/app_window.h" |
| 6 #include "apps/app_window_registry.h" | 6 #include "apps/app_window_registry.h" |
| 7 #include "apps/ui/native_app_window.h" | 7 #include "apps/ui/native_app_window.h" |
| 8 #include "ash/desktop_background/desktop_background_controller.h" | 8 #include "ash/desktop_background/desktop_background_controller.h" |
| 9 #include "ash/desktop_background/desktop_background_controller_observer.h" | 9 #include "ash/desktop_background/desktop_background_controller_observer.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "components/signin/core/common/signin_pref_names.h" | 44 #include "components/signin/core/common/signin_pref_names.h" |
| 45 #include "content/public/browser/notification_observer.h" | 45 #include "content/public/browser/notification_observer.h" |
| 46 #include "content/public/browser/notification_registrar.h" | 46 #include "content/public/browser/notification_registrar.h" |
| 47 #include "content/public/browser/notification_service.h" | 47 #include "content/public/browser/notification_service.h" |
| 48 #include "content/public/test/browser_test_utils.h" | 48 #include "content/public/test/browser_test_utils.h" |
| 49 #include "extensions/browser/extension_system.h" | 49 #include "extensions/browser/extension_system.h" |
| 50 #include "google_apis/gaia/gaia_constants.h" | 50 #include "google_apis/gaia/gaia_constants.h" |
| 51 #include "google_apis/gaia/gaia_switches.h" | 51 #include "google_apis/gaia/gaia_switches.h" |
| 52 #include "google_apis/gaia/gaia_urls.h" | 52 #include "google_apis/gaia/gaia_urls.h" |
| 53 #include "net/test/embedded_test_server/embedded_test_server.h" | 53 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 54 #include "ui/keyboard/keyboard_util.h" |
| 54 | 55 |
| 55 namespace em = enterprise_management; | 56 namespace em = enterprise_management; |
| 56 | 57 |
| 57 namespace chromeos { | 58 namespace chromeos { |
| 58 | 59 |
| 59 namespace { | 60 namespace { |
| 60 | 61 |
| 61 // This is a simple test app that creates an app window and immediately closes | 62 // This is a simple test app that creates an app window and immediately closes |
| 62 // it again. Webstore data json is in | 63 // it again. Webstore data json is in |
| 63 // chrome/test/data/chromeos/app_mode/webstore/inlineinstall/ | 64 // chrome/test/data/chromeos/app_mode/webstore/inlineinstall/ |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 scoped_ptr<MockUserManager> mock_user_manager_; | 512 scoped_ptr<MockUserManager> mock_user_manager_; |
| 512 | 513 |
| 513 DISALLOW_COPY_AND_ASSIGN(KioskTest); | 514 DISALLOW_COPY_AND_ASSIGN(KioskTest); |
| 514 }; | 515 }; |
| 515 | 516 |
| 516 IN_PROC_BROWSER_TEST_F(KioskTest, InstallAndLaunchApp) { | 517 IN_PROC_BROWSER_TEST_F(KioskTest, InstallAndLaunchApp) { |
| 517 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); | 518 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); |
| 518 WaitForAppLaunchSuccess(); | 519 WaitForAppLaunchSuccess(); |
| 519 } | 520 } |
| 520 | 521 |
| 522 IN_PROC_BROWSER_TEST_F(KioskTest, EnableKioskVirtualKeyboard) { |
| 523 // Keyboard disabled by default. |
| 524 EXPECT_FALSE(keyboard::IsKeyboardEnabled()); |
| 525 // Mock policy layout. |
| 526 CrosSettings::Get()->SetString(kKioskVirtualKeyboardLayout, "en-us"); |
| 527 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); |
| 528 WaitForAppLaunchSuccess(); |
| 529 // Keyboard should now be enabled. |
| 530 EXPECT_TRUE(keyboard::IsKeyboardEnabled()); |
| 531 } |
| 532 |
| 521 IN_PROC_BROWSER_TEST_F(KioskTest, NotSignedInWithGAIAAccount) { | 533 IN_PROC_BROWSER_TEST_F(KioskTest, NotSignedInWithGAIAAccount) { |
| 522 // Tests that the kiosk session is not considered to be logged in with a GAIA | 534 // Tests that the kiosk session is not considered to be logged in with a GAIA |
| 523 // account. | 535 // account. |
| 524 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); | 536 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); |
| 525 WaitForAppLaunchSuccess(); | 537 WaitForAppLaunchSuccess(); |
| 526 | 538 |
| 527 Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); | 539 Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); |
| 528 ASSERT_TRUE(app_profile); | 540 ASSERT_TRUE(app_profile); |
| 529 EXPECT_FALSE(app_profile->GetPrefs()->HasPrefPath( | 541 EXPECT_FALSE(app_profile->GetPrefs()->HasPrefPath( |
| 530 prefs::kGoogleServicesUsername)); | 542 prefs::kGoogleServicesUsername)); |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1187 content::WindowedNotificationObserver( | 1199 content::WindowedNotificationObserver( |
| 1188 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1200 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
| 1189 content::NotificationService::AllSources()).Wait(); | 1201 content::NotificationService::AllSources()).Wait(); |
| 1190 | 1202 |
| 1191 // Wait for the wallpaper to load. | 1203 // Wait for the wallpaper to load. |
| 1192 WaitForWallpaper(); | 1204 WaitForWallpaper(); |
| 1193 EXPECT_TRUE(wallpaper_loaded()); | 1205 EXPECT_TRUE(wallpaper_loaded()); |
| 1194 } | 1206 } |
| 1195 | 1207 |
| 1196 } // namespace chromeos | 1208 } // namespace chromeos |
| OLD | NEW |