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 ScopedCanConfigureNetwork can_configure_network(true, false); |
| 593 |
| 594 // Start app launch and wait for network connectivity timeout. |
| 595 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); |
| 596 OobeScreenWaiter splash_waiter(OobeDisplay::SCREEN_APP_LAUNCH_SPLASH); |
| 597 splash_waiter.Wait(); |
| 598 |
| 599 // A network error screen should be shown after authenticating. |
| 600 OobeScreenWaiter error_screen_waiter(OobeDisplay::SCREEN_ERROR_MESSAGE); |
| 601 // Simulate Ctrl+Alt+N accelerator. |
| 602 GetLoginUI()->CallJavascriptFunction( |
| 603 "cr.ui.Oobe.handleAccelerator", |
| 604 base::StringValue("app_launch_network_config")); |
| 605 error_screen_waiter.Wait(); |
| 606 ASSERT_TRUE(GetAppLaunchController()->showing_network_dialog()); |
| 607 |
| 608 // Continue button should be visible since we are online. |
| 609 JsExpect("$('continue-network-config-btn').hidden == false"); |
| 610 |
| 611 // Click on [Continue] button. |
| 612 ASSERT_TRUE(content::ExecuteScript( |
| 613 GetLoginUI()->GetWebContents(), |
| 614 "(function() {" |
| 615 "var e = new Event('click');" |
| 616 "$('continue-network-config-btn').dispatchEvent(e);" |
| 617 "})();")); |
| 618 |
| 619 WaitForAppLaunchSuccess(); |
| 620 } |
| 621 |
591 IN_PROC_BROWSER_TEST_F(KioskTest, LaunchAppNetworkDownConfigureNotAllowed) { | 622 IN_PROC_BROWSER_TEST_F(KioskTest, LaunchAppNetworkDownConfigureNotAllowed) { |
592 // Mock network could not be configured. | 623 // Mock network could not be configured. |
593 ScopedCanConfigureNetwork can_configure_network(false, true); | 624 ScopedCanConfigureNetwork can_configure_network(false, true); |
594 | 625 |
595 // Start app launch and wait for network connectivity timeout. | 626 // Start app launch and wait for network connectivity timeout. |
596 StartAppLaunchFromLoginScreen(SimulateNetworkOfflineClosure()); | 627 StartAppLaunchFromLoginScreen(SimulateNetworkOfflineClosure()); |
597 OobeScreenWaiter splash_waiter(OobeDisplay::SCREEN_APP_LAUNCH_SPLASH); | 628 OobeScreenWaiter splash_waiter(OobeDisplay::SCREEN_APP_LAUNCH_SPLASH); |
598 splash_waiter.Wait(); | 629 splash_waiter.Wait(); |
599 WaitForAppLaunchNetworkTimeout(); | 630 WaitForAppLaunchNetworkTimeout(); |
600 | 631 |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1282 content::WindowedNotificationObserver( | 1313 content::WindowedNotificationObserver( |
1283 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1314 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
1284 content::NotificationService::AllSources()).Wait(); | 1315 content::NotificationService::AllSources()).Wait(); |
1285 | 1316 |
1286 // Wait for the wallpaper to load. | 1317 // Wait for the wallpaper to load. |
1287 WaitForWallpaper(); | 1318 WaitForWallpaper(); |
1288 EXPECT_TRUE(wallpaper_loaded()); | 1319 EXPECT_TRUE(wallpaper_loaded()); |
1289 } | 1320 } |
1290 | 1321 |
1291 } // namespace chromeos | 1322 } // namespace chromeos |
OLD | NEW |