| 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" |
| 11 #include "base/bind.h" | |
| 12 #include "base/bind_helpers.h" | |
| 13 #include "base/callback.h" | |
| 14 #include "base/command_line.h" | |
| 15 #include "base/location.h" | |
| 16 #include "base/memory/scoped_ptr.h" | |
| 17 #include "base/message_loop/message_loop.h" | |
| 18 #include "base/path_service.h" | |
| 19 #include "base/prefs/scoped_user_pref_update.h" | |
| 20 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 21 #include "chrome/browser/chrome_browser_main.h" | |
| 22 #include "chrome/browser/chrome_browser_main_extra_parts.h" | |
| 23 #include "chrome/browser/chrome_content_browser_client.h" | |
| 24 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
| 25 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" | 13 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" |
| 26 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 14 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 27 #include "chrome/browser/chromeos/login/app_launch_controller.h" | 15 #include "chrome/browser/chromeos/login/app_launch_controller.h" |
| 28 #include "chrome/browser/chromeos/login/app_launch_signin_screen.h" | |
| 29 #include "chrome/browser/chromeos/login/existing_user_controller.h" | |
| 30 #include "chrome/browser/chromeos/login/fake_user_manager.h" | 16 #include "chrome/browser/chromeos/login/fake_user_manager.h" |
| 31 #include "chrome/browser/chromeos/login/login_display_host_impl.h" | |
| 32 #include "chrome/browser/chromeos/login/mock_user_manager.h" | 17 #include "chrome/browser/chromeos/login/mock_user_manager.h" |
| 18 #include "chrome/browser/chromeos/login/oobe_base_test.h" |
| 33 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" | 19 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" |
| 34 #include "chrome/browser/chromeos/login/webui_login_display.h" | |
| 35 #include "chrome/browser/chromeos/login/wizard_controller.h" | 20 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 36 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" | |
| 37 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" | 21 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" |
| 38 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" | 22 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
| 39 #include "chrome/browser/chromeos/settings/cros_settings.h" | |
| 40 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h" | 23 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h" |
| 41 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h
" | 24 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h
" |
| 42 #include "chrome/browser/extensions/extension_service.h" | 25 #include "chrome/browser/extensions/extension_service.h" |
| 43 #include "chrome/browser/extensions/extension_system.h" | 26 #include "chrome/browser/extensions/extension_system.h" |
| 44 #include "chrome/browser/extensions/extension_test_message_listener.h" | 27 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 45 #include "chrome/browser/lifetime/application_lifetime.h" | |
| 46 #include "chrome/browser/profiles/profile_manager.h" | |
| 47 #include "chrome/browser/ui/browser.h" | |
| 48 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | |
| 49 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" | |
| 50 #include "chrome/common/chrome_paths.h" | |
| 51 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 52 #include "chrome/common/pref_names.h" | 29 #include "chrome/common/pref_names.h" |
| 53 #include "chrome/test/base/in_process_browser_test.h" | |
| 54 #include "chrome/test/base/interactive_test_utils.h" | |
| 55 #include "chrome/test/base/ui_test_utils.h" | |
| 56 #include "chromeos/chromeos_switches.h" | 30 #include "chromeos/chromeos_switches.h" |
| 57 #include "chromeos/settings/cros_settings_names.h" | |
| 58 #include "components/policy/core/common/cloud/policy_builder.h" | |
| 59 #include "content/public/browser/notification_observer.h" | 31 #include "content/public/browser/notification_observer.h" |
| 60 #include "content/public/browser/notification_registrar.h" | 32 #include "content/public/browser/notification_registrar.h" |
| 61 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
| 62 #include "content/public/test/browser_test_utils.h" | 34 #include "content/public/test/browser_test_utils.h" |
| 63 #include "content/public/test/test_utils.h" | |
| 64 #include "extensions/common/extension.h" | |
| 65 #include "google_apis/gaia/fake_gaia.h" | |
| 66 #include "google_apis/gaia/gaia_constants.h" | 35 #include "google_apis/gaia/gaia_constants.h" |
| 67 #include "google_apis/gaia/gaia_switches.h" | 36 #include "google_apis/gaia/gaia_switches.h" |
| 68 #include "google_apis/gaia/gaia_urls.h" | 37 #include "google_apis/gaia/gaia_urls.h" |
| 69 #include "net/base/network_change_notifier.h" | |
| 70 #include "net/dns/mock_host_resolver.h" | |
| 71 #include "net/test/embedded_test_server/embedded_test_server.h" | |
| 72 #include "net/test/embedded_test_server/http_request.h" | |
| 73 #include "net/test/embedded_test_server/http_response.h" | |
| 74 #include "testing/gmock/include/gmock/gmock.h" | |
| 75 #include "testing/gtest/include/gtest/gtest.h" | |
| 76 #include "ui/aura/window.h" | |
| 77 #include "ui/compositor/layer.h" | |
| 78 | 38 |
| 79 namespace em = enterprise_management; | 39 namespace em = enterprise_management; |
| 80 | 40 |
| 81 namespace chromeos { | 41 namespace chromeos { |
| 82 | 42 |
| 83 namespace { | 43 namespace { |
| 84 | 44 |
| 85 // This is a simple test app that creates an app window and immediately closes | 45 // This is a simple test app that creates an app window and immediately closes |
| 86 // it again. Webstore data json is in | 46 // it again. Webstore data json is in |
| 87 // chrome/test/data/chromeos/app_mode/webstore/inlineinstall/ | 47 // chrome/test/data/chromeos/app_mode/webstore/inlineinstall/ |
| (...skipping 16 matching lines...) Expand all Loading... |
| 104 const char kTestEnterpriseAccountId[] = "enterprise-kiosk-app@localhost"; | 64 const char kTestEnterpriseAccountId[] = "enterprise-kiosk-app@localhost"; |
| 105 const char kTestEnterpriseServiceAccountId[] = "service_account@example.com"; | 65 const char kTestEnterpriseServiceAccountId[] = "service_account@example.com"; |
| 106 const char kTestRefreshToken[] = "fake-refresh-token"; | 66 const char kTestRefreshToken[] = "fake-refresh-token"; |
| 107 const char kTestUserinfoToken[] = "fake-userinfo-token"; | 67 const char kTestUserinfoToken[] = "fake-userinfo-token"; |
| 108 const char kTestLoginToken[] = "fake-login-token"; | 68 const char kTestLoginToken[] = "fake-login-token"; |
| 109 const char kTestAccessToken[] = "fake-access-token"; | 69 const char kTestAccessToken[] = "fake-access-token"; |
| 110 const char kTestClientId[] = "fake-client-id"; | 70 const char kTestClientId[] = "fake-client-id"; |
| 111 const char kTestAppScope[] = | 71 const char kTestAppScope[] = |
| 112 "https://www.googleapis.com/auth/userinfo.profile"; | 72 "https://www.googleapis.com/auth/userinfo.profile"; |
| 113 | 73 |
| 114 // Note the path name must be the same as in shill stub. | |
| 115 const char kStubEthernetServicePath[] = "eth1"; | |
| 116 | |
| 117 // Helper function for GetConsumerKioskModeStatusCallback. | 74 // Helper function for GetConsumerKioskModeStatusCallback. |
| 118 void ConsumerKioskModeStatusCheck( | 75 void ConsumerKioskModeStatusCheck( |
| 119 KioskAppManager::ConsumerKioskModeStatus* out_status, | 76 KioskAppManager::ConsumerKioskModeStatus* out_status, |
| 120 const base::Closure& runner_quit_task, | 77 const base::Closure& runner_quit_task, |
| 121 KioskAppManager::ConsumerKioskModeStatus in_status) { | 78 KioskAppManager::ConsumerKioskModeStatus in_status) { |
| 122 LOG(INFO) << "KioskAppManager::ConsumerKioskModeStatus = " << in_status; | 79 LOG(INFO) << "KioskAppManager::ConsumerKioskModeStatus = " << in_status; |
| 123 *out_status = in_status; | 80 *out_status = in_status; |
| 124 runner_quit_task.Run(); | 81 runner_quit_task.Run(); |
| 125 } | 82 } |
| 126 | 83 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 private: | 181 private: |
| 225 apps::ShellWindowRegistry* registry_; | 182 apps::ShellWindowRegistry* registry_; |
| 226 std::string app_id_; | 183 std::string app_id_; |
| 227 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; | 184 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; |
| 228 apps::ShellWindow* window_; | 185 apps::ShellWindow* window_; |
| 229 bool running_; | 186 bool running_; |
| 230 | 187 |
| 231 DISALLOW_COPY_AND_ASSIGN(ShellWindowObserver); | 188 DISALLOW_COPY_AND_ASSIGN(ShellWindowObserver); |
| 232 }; | 189 }; |
| 233 | 190 |
| 234 class KioskTest : public InProcessBrowserTest { | 191 class KioskTest : public OobeBaseTest { |
| 235 public: | 192 public: |
| 236 KioskTest() { | 193 KioskTest() { |
| 237 set_exit_when_last_browser_closes(false); | 194 set_exit_when_last_browser_closes(false); |
| 238 } | 195 } |
| 239 | 196 |
| 240 virtual ~KioskTest() {} | 197 virtual ~KioskTest() {} |
| 241 | 198 |
| 242 protected: | 199 protected: |
| 200 |
| 243 virtual void SetUp() OVERRIDE { | 201 virtual void SetUp() OVERRIDE { |
| 244 base::FilePath test_data_dir; | |
| 245 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); | |
| 246 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); | |
| 247 embedded_test_server()->RegisterRequestHandler( | |
| 248 base::Bind(&FakeGaia::HandleRequest, base::Unretained(&fake_gaia_))); | |
| 249 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | |
| 250 // Stop IO thread here because no threads are allowed while | |
| 251 // spawning sandbox host process. See crbug.com/322732. | |
| 252 embedded_test_server()->StopThread(); | |
| 253 | |
| 254 mock_user_manager_.reset(new MockUserManager); | 202 mock_user_manager_.reset(new MockUserManager); |
| 255 AppLaunchController::SkipSplashWaitForTesting(); | 203 AppLaunchController::SkipSplashWaitForTesting(); |
| 256 AppLaunchController::SetNetworkWaitForTesting(kTestNetworkTimeoutSeconds); | 204 AppLaunchController::SetNetworkWaitForTesting(kTestNetworkTimeoutSeconds); |
| 257 | 205 |
| 258 InProcessBrowserTest::SetUp(); | 206 OobeBaseTest::SetUp(); |
| 259 } | |
| 260 | |
| 261 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | |
| 262 host_resolver()->AddRule("*", "127.0.0.1"); | |
| 263 | |
| 264 network_portal_detector_ = new NetworkPortalDetectorTestImpl(); | |
| 265 NetworkPortalDetector::InitializeForTesting(network_portal_detector_); | |
| 266 network_portal_detector_->SetDefaultNetworkPathForTesting( | |
| 267 kStubEthernetServicePath); | |
| 268 } | |
| 269 | |
| 270 virtual void SetUpOnMainThread() OVERRIDE { | |
| 271 // Restart the thread as the sandbox host process has already been spawned. | |
| 272 embedded_test_server()->RestartThreadAndListen(); | |
| 273 } | 207 } |
| 274 | 208 |
| 275 virtual void CleanUpOnMainThread() OVERRIDE { | 209 virtual void CleanUpOnMainThread() OVERRIDE { |
| 276 AppLaunchController::SetNetworkTimeoutCallbackForTesting(NULL); | 210 AppLaunchController::SetNetworkTimeoutCallbackForTesting(NULL); |
| 277 AppLaunchSigninScreen::SetUserManagerForTesting(NULL); | 211 AppLaunchSigninScreen::SetUserManagerForTesting(NULL); |
| 278 | 212 |
| 279 // If the login display is still showing, exit gracefully. | 213 OobeBaseTest::CleanUpOnMainThread(); |
| 280 if (LoginDisplayHostImpl::default_host()) { | |
| 281 base::MessageLoop::current()->PostTask(FROM_HERE, | |
| 282 base::Bind(&chrome::AttemptExit)); | |
| 283 content::RunMessageLoop(); | |
| 284 } | |
| 285 | 214 |
| 286 // Clean up while main thread still runs. | 215 // Clean up while main thread still runs. |
| 287 // See http://crbug.com/176659. | 216 // See http://crbug.com/176659. |
| 288 KioskAppManager::Get()->CleanUp(); | 217 KioskAppManager::Get()->CleanUp(); |
| 289 } | 218 } |
| 290 | 219 |
| 291 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 220 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 292 command_line->AppendSwitch(chromeos::switches::kLoginManager); | 221 OobeBaseTest::SetUpCommandLine(command_line); |
| 293 command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); | |
| 294 command_line->AppendSwitch(::switches::kDisableBackgroundNetworking); | |
| 295 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); | |
| 296 | 222 |
| 297 // Create gaia and webstore URL from test server url but using different | 223 // Create gaia and webstore URL from test server url but using different |
| 298 // host names. This is to avoid gaia response being tagged as from | 224 // host names. This is to avoid gaia response being tagged as from |
| 299 // webstore in chrome_resource_dispatcher_host_delegate.cc. | 225 // webstore in chrome_resource_dispatcher_host_delegate.cc. |
| 300 const GURL& server_url = embedded_test_server()->base_url(); | 226 const GURL& server_url = embedded_test_server()->base_url(); |
| 301 | |
| 302 std::string gaia_host("gaia"); | |
| 303 GURL::Replacements replace_gaia_host; | |
| 304 replace_gaia_host.SetHostStr(gaia_host); | |
| 305 GURL gaia_url = server_url.ReplaceComponents(replace_gaia_host); | |
| 306 command_line->AppendSwitchASCII(::switches::kGaiaUrl, gaia_url.spec()); | |
| 307 command_line->AppendSwitchASCII(::switches::kLsoUrl, gaia_url.spec()); | |
| 308 command_line->AppendSwitchASCII(::switches::kGoogleApisUrl, | |
| 309 gaia_url.spec()); | |
| 310 | |
| 311 std::string webstore_host("webstore"); | 227 std::string webstore_host("webstore"); |
| 312 GURL::Replacements replace_webstore_host; | 228 GURL::Replacements replace_webstore_host; |
| 313 replace_webstore_host.SetHostStr(webstore_host); | 229 replace_webstore_host.SetHostStr(webstore_host); |
| 314 GURL webstore_url = server_url.ReplaceComponents(replace_webstore_host); | 230 GURL webstore_url = server_url.ReplaceComponents(replace_webstore_host); |
| 315 command_line->AppendSwitchASCII( | 231 command_line->AppendSwitchASCII( |
| 316 ::switches::kAppsGalleryURL, | 232 ::switches::kAppsGalleryURL, |
| 317 webstore_url.Resolve("/chromeos/app_mode/webstore").spec()); | 233 webstore_url.Resolve("/chromeos/app_mode/webstore").spec()); |
| 318 command_line->AppendSwitchASCII( | 234 command_line->AppendSwitchASCII( |
| 319 ::switches::kAppsGalleryDownloadURL, | 235 ::switches::kAppsGalleryDownloadURL, |
| 320 webstore_url.Resolve( | 236 webstore_url.Resolve( |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 | 317 |
| 402 // Wait until the app terminates if it is still running. | 318 // Wait until the app terminates if it is still running. |
| 403 if (!shell_window_registry->GetShellWindowsForApp(kTestKioskApp).empty()) | 319 if (!shell_window_registry->GetShellWindowsForApp(kTestKioskApp).empty()) |
| 404 content::RunMessageLoop(); | 320 content::RunMessageLoop(); |
| 405 | 321 |
| 406 // Check that the app had been informed that it is running in a kiosk | 322 // Check that the app had been informed that it is running in a kiosk |
| 407 // session. | 323 // session. |
| 408 EXPECT_TRUE(launch_data_check_listener.was_satisfied()); | 324 EXPECT_TRUE(launch_data_check_listener.was_satisfied()); |
| 409 } | 325 } |
| 410 | 326 |
| 411 void SimulateNetworkOffline() { | |
| 412 NetworkPortalDetector::CaptivePortalState offline_state; | |
| 413 offline_state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE; | |
| 414 network_portal_detector_->SetDetectionResultsForTesting( | |
| 415 kStubEthernetServicePath, offline_state); | |
| 416 network_portal_detector_->NotifyObserversForTesting(); | |
| 417 } | |
| 418 | |
| 419 base::Closure SimulateNetworkOfflineClosure() { | |
| 420 return base::Bind(&KioskTest::SimulateNetworkOffline, | |
| 421 base::Unretained(this)); | |
| 422 } | |
| 423 | |
| 424 void SimulateNetworkOnline() { | |
| 425 NetworkPortalDetector::CaptivePortalState online_state; | |
| 426 online_state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE; | |
| 427 online_state.response_code = 204; | |
| 428 network_portal_detector_->SetDetectionResultsForTesting( | |
| 429 kStubEthernetServicePath, online_state); | |
| 430 network_portal_detector_->NotifyObserversForTesting(); | |
| 431 } | |
| 432 | |
| 433 base::Closure SimulateNetworkOnlineClosure() { | |
| 434 return base::Bind(&KioskTest::SimulateNetworkOnline, | |
| 435 base::Unretained(this)); | |
| 436 } | |
| 437 | |
| 438 void SimulateNetworkPortal() { | |
| 439 NetworkPortalDetector::CaptivePortalState portal_state; | |
| 440 portal_state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL; | |
| 441 network_portal_detector_->SetDetectionResultsForTesting( | |
| 442 kStubEthernetServicePath, portal_state); | |
| 443 network_portal_detector_->NotifyObserversForTesting(); | |
| 444 } | |
| 445 | |
| 446 base::Closure SimulateNetworkPortalClosure() { | |
| 447 return base::Bind(&KioskTest::SimulateNetworkPortal, | |
| 448 base::Unretained(this)); | |
| 449 } | |
| 450 | |
| 451 void WaitForAppLaunchNetworkTimeout() { | 327 void WaitForAppLaunchNetworkTimeout() { |
| 452 if (GetAppLaunchController()->network_wait_timedout()) | 328 if (GetAppLaunchController()->network_wait_timedout()) |
| 453 return; | 329 return; |
| 454 | 330 |
| 455 scoped_refptr<content::MessageLoopRunner> runner = | 331 scoped_refptr<content::MessageLoopRunner> runner = |
| 456 new content::MessageLoopRunner; | 332 new content::MessageLoopRunner; |
| 457 | 333 |
| 458 base::Closure callback = base::Bind( | 334 base::Closure callback = base::Bind( |
| 459 &OnNetworkWaitTimedOut, runner->QuitClosure()); | 335 &OnNetworkWaitTimedOut, runner->QuitClosure()); |
| 460 AppLaunchController::SetNetworkTimeoutCallbackForTesting(&callback); | 336 AppLaunchController::SetNetworkTimeoutCallbackForTesting(&callback); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 484 new content::MessageLoopRunner; | 360 new content::MessageLoopRunner; |
| 485 KioskAppManager::Get()->GetConsumerKioskModeStatus( | 361 KioskAppManager::Get()->GetConsumerKioskModeStatus( |
| 486 base::Bind(&ConsumerKioskModeStatusCheck, | 362 base::Bind(&ConsumerKioskModeStatusCheck, |
| 487 &status, | 363 &status, |
| 488 runner->QuitClosure())); | 364 runner->QuitClosure())); |
| 489 runner->Run(); | 365 runner->Run(); |
| 490 CHECK_NE(status, static_cast<KioskAppManager::ConsumerKioskModeStatus>(-1)); | 366 CHECK_NE(status, static_cast<KioskAppManager::ConsumerKioskModeStatus>(-1)); |
| 491 return status; | 367 return status; |
| 492 } | 368 } |
| 493 | 369 |
| 494 void JsExpect(const std::string& expression) { | |
| 495 bool result; | |
| 496 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | |
| 497 GetLoginUI()->GetWebContents(), | |
| 498 "window.domAutomationController.send(!!(" + expression + "));", | |
| 499 &result)); | |
| 500 ASSERT_TRUE(result) << expression; | |
| 501 } | |
| 502 | |
| 503 content::WebUI* GetLoginUI() { | |
| 504 return static_cast<chromeos::LoginDisplayHostImpl*>( | |
| 505 chromeos::LoginDisplayHostImpl::default_host())->GetOobeUI()->web_ui(); | |
| 506 } | |
| 507 | |
| 508 SigninScreenHandler* GetSigninScreenHandler() { | |
| 509 return static_cast<chromeos::LoginDisplayHostImpl*>( | |
| 510 chromeos::LoginDisplayHostImpl::default_host()) | |
| 511 ->GetOobeUI() | |
| 512 ->signin_screen_handler_for_test(); | |
| 513 } | |
| 514 | |
| 515 AppLaunchController* GetAppLaunchController() { | 370 AppLaunchController* GetAppLaunchController() { |
| 516 return chromeos::LoginDisplayHostImpl::default_host() | 371 return chromeos::LoginDisplayHostImpl::default_host() |
| 517 ->GetAppLaunchController(); | 372 ->GetAppLaunchController(); |
| 518 } | 373 } |
| 519 | 374 |
| 520 FakeGaia fake_gaia_; | |
| 521 scoped_ptr<MockUserManager> mock_user_manager_; | 375 scoped_ptr<MockUserManager> mock_user_manager_; |
| 522 NetworkPortalDetectorTestImpl* network_portal_detector_; | |
| 523 }; | 376 }; |
| 524 | 377 |
| 525 IN_PROC_BROWSER_TEST_F(KioskTest, InstallAndLaunchApp) { | 378 IN_PROC_BROWSER_TEST_F(KioskTest, InstallAndLaunchApp) { |
| 526 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); | 379 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); |
| 527 WaitForAppLaunchSuccess(); | 380 WaitForAppLaunchSuccess(); |
| 528 } | 381 } |
| 529 | 382 |
| 530 IN_PROC_BROWSER_TEST_F(KioskTest, LaunchAppNetworkDown) { | 383 IN_PROC_BROWSER_TEST_F(KioskTest, LaunchAppNetworkDown) { |
| 531 // Mock network could be configured with owner's password. | 384 // Mock network could be configured with owner's password. |
| 532 ScopedCanConfigureNetwork can_configure_network(true, true); | 385 ScopedCanConfigureNetwork can_configure_network(true, true); |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 content::WindowedNotificationObserver( | 891 content::WindowedNotificationObserver( |
| 1039 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 892 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
| 1040 content::NotificationService::AllSources()).Wait(); | 893 content::NotificationService::AllSources()).Wait(); |
| 1041 | 894 |
| 1042 // Wait for the wallpaper to load. | 895 // Wait for the wallpaper to load. |
| 1043 WaitForWallpaper(); | 896 WaitForWallpaper(); |
| 1044 EXPECT_TRUE(wallpaper_loaded()); | 897 EXPECT_TRUE(wallpaper_loaded()); |
| 1045 } | 898 } |
| 1046 | 899 |
| 1047 } // namespace chromeos | 900 } // namespace chromeos |
| OLD | NEW |