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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 ASSERT_TRUE( | 445 ASSERT_TRUE( |
446 base::CopyFile(test_data_dir.Append(chrome::kPreferencesFilename), | 446 base::CopyFile(test_data_dir.Append(chrome::kPreferencesFilename), |
447 app_profile_dir.Append(chrome::kPreferencesFilename))); | 447 app_profile_dir.Append(chrome::kPreferencesFilename))); |
448 ASSERT_TRUE( | 448 ASSERT_TRUE( |
449 base::CopyDirectory(test_data_dir.AppendASCII("Extensions"), | 449 base::CopyDirectory(test_data_dir.AppendASCII("Extensions"), |
450 app_profile_dir, | 450 app_profile_dir, |
451 true)); | 451 true)); |
452 } | 452 } |
453 | 453 |
454 void RunAppLaunchNetworkDownTest() { | 454 void RunAppLaunchNetworkDownTest() { |
455 mock_user_manager()->SetActiveUser(kTestOwnerEmail); | |
456 AppLaunchSigninScreen::SetUserManagerForTesting(mock_user_manager()); | |
457 | |
458 // Mock network could be configured with owner's password. | 455 // Mock network could be configured with owner's password. |
459 ScopedCanConfigureNetwork can_configure_network(true, true); | 456 ScopedCanConfigureNetwork can_configure_network(true, true); |
460 | 457 |
461 // Start app launch and wait for network connectivity timeout. | 458 // Start app launch and wait for network connectivity timeout. |
462 StartAppLaunchFromLoginScreen(SimulateNetworkOfflineClosure()); | 459 StartAppLaunchFromLoginScreen(SimulateNetworkOfflineClosure()); |
463 OobeScreenWaiter splash_waiter(OobeDisplay::SCREEN_APP_LAUNCH_SPLASH); | 460 OobeScreenWaiter splash_waiter(OobeDisplay::SCREEN_APP_LAUNCH_SPLASH); |
464 splash_waiter.Wait(); | 461 splash_waiter.Wait(); |
465 WaitForAppLaunchNetworkTimeout(); | 462 WaitForAppLaunchNetworkTimeout(); |
466 | 463 |
467 // Configure network link should be visible. | 464 // Configure network link should be visible. |
468 JsExpect("$('splash-config-network').hidden == false"); | 465 JsExpect("$('splash-config-network').hidden == false"); |
469 | 466 |
470 // Set up fake user manager with an owner for the test. | 467 // Set up fake user manager with an owner for the test. |
| 468 mock_user_manager()->SetActiveUser(kTestOwnerEmail); |
| 469 AppLaunchSigninScreen::SetUserManagerForTesting(mock_user_manager()); |
471 static_cast<LoginDisplayHostImpl*>(LoginDisplayHostImpl::default_host()) | 470 static_cast<LoginDisplayHostImpl*>(LoginDisplayHostImpl::default_host()) |
472 ->GetOobeUI()->ShowOobeUI(false); | 471 ->GetOobeUI()->ShowOobeUI(false); |
473 | 472 |
474 // Configure network should bring up lock screen for owner. | 473 // Configure network should bring up lock screen for owner. |
475 OobeScreenWaiter lock_screen_waiter(OobeDisplay::SCREEN_ACCOUNT_PICKER); | 474 OobeScreenWaiter lock_screen_waiter(OobeDisplay::SCREEN_ACCOUNT_PICKER); |
476 static_cast<AppLaunchSplashScreenActor::Delegate*>(GetAppLaunchController()) | 475 static_cast<AppLaunchSplashScreenActor::Delegate*>(GetAppLaunchController()) |
477 ->OnConfigureNetwork(); | 476 ->OnConfigureNetwork(); |
478 lock_screen_waiter.Wait(); | 477 lock_screen_waiter.Wait(); |
479 | 478 |
480 // There should be only one owner pod on this screen. | 479 // There should be only one owner pod on this screen. |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1187 content::WindowedNotificationObserver( | 1186 content::WindowedNotificationObserver( |
1188 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1187 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
1189 content::NotificationService::AllSources()).Wait(); | 1188 content::NotificationService::AllSources()).Wait(); |
1190 | 1189 |
1191 // Wait for the wallpaper to load. | 1190 // Wait for the wallpaper to load. |
1192 WaitForWallpaper(); | 1191 WaitForWallpaper(); |
1193 EXPECT_TRUE(wallpaper_loaded()); | 1192 EXPECT_TRUE(wallpaper_loaded()); |
1194 } | 1193 } |
1195 | 1194 |
1196 } // namespace chromeos | 1195 } // namespace chromeos |
OLD | NEW |