Chromium Code Reviews| 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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 581 // Tests the network down case for the initial app download and launch. | 581 // Tests the network down case for the initial app download and launch. |
| 582 RunAppLaunchNetworkDownTest(); | 582 RunAppLaunchNetworkDownTest(); |
| 583 } | 583 } |
| 584 | 584 |
| 585 IN_PROC_BROWSER_TEST_F(KioskTest, LaunchAppNetworkDown) { | 585 IN_PROC_BROWSER_TEST_F(KioskTest, LaunchAppNetworkDown) { |
| 586 // Tests the network down case for launching an existing app that is | 586 // Tests the network down case for launching an existing app that is |
| 587 // installed in PRE_LaunchAppNetworkDown. | 587 // installed in PRE_LaunchAppNetworkDown. |
| 588 RunAppLaunchNetworkDownTest(); | 588 RunAppLaunchNetworkDownTest(); |
| 589 } | 589 } |
| 590 | 590 |
| 591 IN_PROC_BROWSER_TEST_F(KioskTest, LaunchAppWithNetworkConfigAccelerator) { | |
| 592 // Mock network could be configured with owner's password. | |
|
xiyuan
2014/03/25 05:21:19
nit: The comments need to be updated. The 2nd arg
zel
2014/03/25 22:26:32
Done.
| |
| 593 ScopedCanConfigureNetwork can_configure_network(true, false); | |
| 594 | |
| 595 // Start app launch and wait for network connectivity timeout. | |
| 596 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); | |
| 597 OobeScreenWaiter splash_waiter(OobeDisplay::SCREEN_APP_LAUNCH_SPLASH); | |
| 598 splash_waiter.Wait(); | |
| 599 | |
| 600 // A network error screen should be shown after authenticating. | |
| 601 OobeScreenWaiter error_screen_waiter(OobeDisplay::SCREEN_ERROR_MESSAGE); | |
| 602 // Simulate Ctrl+Alt+N accelerator. | |
| 603 GetLoginUI()->CallJavascriptFunction( | |
| 604 "cr.ui.Oobe.handleAccelerator", | |
| 605 base::StringValue("app_launch_network_config")); | |
| 606 error_screen_waiter.Wait(); | |
| 607 ASSERT_TRUE(GetAppLaunchController()->showing_network_dialog()); | |
| 608 | |
| 609 // Continue button should be visible since we are online. | |
| 610 JsExpect("$('continue-network-config-btn').hidden == false"); | |
| 611 | |
| 612 // Click on [Continue] button. | |
| 613 ASSERT_TRUE(content::ExecuteScript( | |
| 614 GetLoginUI()->GetWebContents(), | |
| 615 "(function() {" | |
| 616 "var e = new Event('click');" | |
| 617 "$('continue-network-config-btn').dispatchEvent(e);" | |
| 618 "})();")); | |
| 619 | |
| 620 WaitForAppLaunchSuccess(); | |
| 621 } | |
| 622 | |
| 591 IN_PROC_BROWSER_TEST_F(KioskTest, LaunchAppNetworkDownConfigureNotAllowed) { | 623 IN_PROC_BROWSER_TEST_F(KioskTest, LaunchAppNetworkDownConfigureNotAllowed) { |
| 592 // Mock network could not be configured. | 624 // Mock network could not be configured. |
| 593 ScopedCanConfigureNetwork can_configure_network(false, true); | 625 ScopedCanConfigureNetwork can_configure_network(false, true); |
| 594 | 626 |
| 595 // Start app launch and wait for network connectivity timeout. | 627 // Start app launch and wait for network connectivity timeout. |
| 596 StartAppLaunchFromLoginScreen(SimulateNetworkOfflineClosure()); | 628 StartAppLaunchFromLoginScreen(SimulateNetworkOfflineClosure()); |
| 597 OobeScreenWaiter splash_waiter(OobeDisplay::SCREEN_APP_LAUNCH_SPLASH); | 629 OobeScreenWaiter splash_waiter(OobeDisplay::SCREEN_APP_LAUNCH_SPLASH); |
| 598 splash_waiter.Wait(); | 630 splash_waiter.Wait(); |
| 599 WaitForAppLaunchNetworkTimeout(); | 631 WaitForAppLaunchNetworkTimeout(); |
| 600 | 632 |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1282 content::WindowedNotificationObserver( | 1314 content::WindowedNotificationObserver( |
| 1283 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1315 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
| 1284 content::NotificationService::AllSources()).Wait(); | 1316 content::NotificationService::AllSources()).Wait(); |
| 1285 | 1317 |
| 1286 // Wait for the wallpaper to load. | 1318 // Wait for the wallpaper to load. |
| 1287 WaitForWallpaper(); | 1319 WaitForWallpaper(); |
| 1288 EXPECT_TRUE(wallpaper_loaded()); | 1320 EXPECT_TRUE(wallpaper_loaded()); |
| 1289 } | 1321 } |
| 1290 | 1322 |
| 1291 } // namespace chromeos | 1323 } // namespace chromeos |
| OLD | NEW |