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/shell_window.h" | 5 #include "apps/shell_window.h" |
6 #include "apps/shell_window_registry.h" | 6 #include "apps/shell_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 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 apps::ShellWindow* window = ShellWindowObserver( | 803 apps::ShellWindow* window = ShellWindowObserver( |
804 apps::ShellWindowRegistry::Get(ProfileManager::GetPrimaryUserProfile()), | 804 apps::ShellWindowRegistry::Get(ProfileManager::GetPrimaryUserProfile()), |
805 kTestEnterpriseKioskApp).Wait(); | 805 kTestEnterpriseKioskApp).Wait(); |
806 ASSERT_TRUE(window); | 806 ASSERT_TRUE(window); |
807 | 807 |
808 // Check whether the app can retrieve an OAuth2 access token. | 808 // Check whether the app can retrieve an OAuth2 access token. |
809 std::string result; | 809 std::string result; |
810 EXPECT_TRUE(content::ExecuteScriptAndExtractString( | 810 EXPECT_TRUE(content::ExecuteScriptAndExtractString( |
811 window->web_contents(), | 811 window->web_contents(), |
812 "chrome.identity.getAuthToken({ 'interactive': false }, function(token) {" | 812 "chrome.identity.getAuthToken({ 'interactive': false }, function(token) {" |
| 813 " window.domAutomationController.setAutomationId(0);" |
813 " window.domAutomationController.send(token);" | 814 " window.domAutomationController.send(token);" |
814 "});", | 815 "});", |
815 &result)); | 816 &result)); |
816 EXPECT_EQ(kTestAccessToken, result); | 817 EXPECT_EQ(kTestAccessToken, result); |
817 | 818 |
818 // Terminate the app. | 819 // Terminate the app. |
819 window->GetBaseWindow()->Close(); | 820 window->GetBaseWindow()->Close(); |
820 content::RunAllPendingInMessageLoop(); | 821 content::RunAllPendingInMessageLoop(); |
821 } | 822 } |
822 | 823 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 content::WindowedNotificationObserver( | 892 content::WindowedNotificationObserver( |
892 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 893 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
893 content::NotificationService::AllSources()).Wait(); | 894 content::NotificationService::AllSources()).Wait(); |
894 | 895 |
895 // Wait for the wallpaper to load. | 896 // Wait for the wallpaper to load. |
896 WaitForWallpaper(); | 897 WaitForWallpaper(); |
897 EXPECT_TRUE(wallpaper_loaded()); | 898 EXPECT_TRUE(wallpaper_loaded()); |
898 } | 899 } |
899 | 900 |
900 } // namespace chromeos | 901 } // namespace chromeos |
OLD | NEW |