| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 virtual ~KioskTest() {} | 242 virtual ~KioskTest() {} |
| 243 | 243 |
| 244 protected: | 244 protected: |
| 245 virtual void SetUp() OVERRIDE { | 245 virtual void SetUp() OVERRIDE { |
| 246 base::FilePath test_data_dir; | 246 base::FilePath test_data_dir; |
| 247 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); | 247 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); |
| 248 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); | 248 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); |
| 249 embedded_test_server()->RegisterRequestHandler( | 249 embedded_test_server()->RegisterRequestHandler( |
| 250 base::Bind(&FakeGaia::HandleRequest, base::Unretained(&fake_gaia_))); | 250 base::Bind(&FakeGaia::HandleRequest, base::Unretained(&fake_gaia_))); |
| 251 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 251 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 252 // Stop IO thread here because no threads are allowed while |
| 253 // spawning sandbox host process. See crbug.com/322732. |
| 254 embedded_test_server()->StopThread(); |
| 252 | 255 |
| 253 mock_user_manager_.reset(new MockUserManager); | 256 mock_user_manager_.reset(new MockUserManager); |
| 254 AppLaunchController::SkipSplashWaitForTesting(); | 257 AppLaunchController::SkipSplashWaitForTesting(); |
| 255 AppLaunchController::SetNetworkWaitForTesting(kTestNetworkTimeoutSeconds); | 258 AppLaunchController::SetNetworkWaitForTesting(kTestNetworkTimeoutSeconds); |
| 256 | 259 |
| 257 InProcessBrowserTest::SetUp(); | 260 InProcessBrowserTest::SetUp(); |
| 258 } | 261 } |
| 259 | 262 |
| 260 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 263 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 261 host_resolver()->AddRule("*", "127.0.0.1"); | 264 host_resolver()->AddRule("*", "127.0.0.1"); |
| 262 } | 265 } |
| 263 | 266 |
| 267 virtual void SetUpOnMainThread() OVERRIDE { |
| 268 // Restart the thread as the sandbox host process has already been spawned. |
| 269 embedded_test_server()->StartThread(); |
| 270 } |
| 271 |
| 264 virtual void CleanUpOnMainThread() OVERRIDE { | 272 virtual void CleanUpOnMainThread() OVERRIDE { |
| 265 // We need to clean up these objects in this specific order. | 273 // We need to clean up these objects in this specific order. |
| 266 fake_network_notifier_.reset(NULL); | 274 fake_network_notifier_.reset(NULL); |
| 267 disable_network_notifier_.reset(NULL); | 275 disable_network_notifier_.reset(NULL); |
| 268 | 276 |
| 269 AppLaunchController::SetNetworkTimeoutCallbackForTesting(NULL); | 277 AppLaunchController::SetNetworkTimeoutCallbackForTesting(NULL); |
| 270 AppLaunchSigninScreen::SetUserManagerForTesting(NULL); | 278 AppLaunchSigninScreen::SetUserManagerForTesting(NULL); |
| 271 | 279 |
| 272 // If the login display is still showing, exit gracefully. | 280 // If the login display is still showing, exit gracefully. |
| 273 if (LoginDisplayHostImpl::default_host()) { | 281 if (LoginDisplayHostImpl::default_host()) { |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 content::WindowedNotificationObserver( | 974 content::WindowedNotificationObserver( |
| 967 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 975 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
| 968 content::NotificationService::AllSources()).Wait(); | 976 content::NotificationService::AllSources()).Wait(); |
| 969 | 977 |
| 970 // Wait for the wallpaper to load. | 978 // Wait for the wallpaper to load. |
| 971 WaitForWallpaper(); | 979 WaitForWallpaper(); |
| 972 EXPECT_TRUE(wallpaper_loaded()); | 980 EXPECT_TRUE(wallpaper_loaded()); |
| 973 } | 981 } |
| 974 | 982 |
| 975 } // namespace chromeos | 983 } // namespace chromeos |
| OLD | NEW |