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