| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/location.h" |
| 9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/single_thread_task_runner.h" |
| 13 #include "base/threading/thread_task_runner_handle.h" |
| 11 #include "chrome/browser/chromeos/login/login_manager_test.h" | 14 #include "chrome/browser/chromeos/login/login_manager_test.h" |
| 12 #include "chrome/browser/chromeos/login/screens/error_screen.h" | 15 #include "chrome/browser/chromeos/login/screens/error_screen.h" |
| 13 #include "chrome/browser/chromeos/login/screens/network_error_view.h" | 16 #include "chrome/browser/chromeos/login/screens/network_error_view.h" |
| 14 #include "chrome/browser/chromeos/login/startup_utils.h" | 17 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 15 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" | 18 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" |
| 16 #include "chrome/browser/chromeos/login/ui/captive_portal_window_proxy.h" | 19 #include "chrome/browser/chromeos/login/ui/captive_portal_window_proxy.h" |
| 17 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 20 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 18 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" | 21 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" |
| 19 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" | 22 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" |
| 20 #include "chrome/test/base/in_process_browser_test.h" | 23 #include "chrome/test/base/in_process_browser_test.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 void SetUpOnMainThread() override { | 86 void SetUpOnMainThread() override { |
| 84 host_ = LoginDisplayHost::default_host(); | 87 host_ = LoginDisplayHost::default_host(); |
| 85 content::WebContents* web_contents = | 88 content::WebContents* web_contents = |
| 86 host_->GetWebUILoginView()->GetWebContents(); | 89 host_->GetWebUILoginView()->GetWebContents(); |
| 87 captive_portal_window_proxy_.reset( | 90 captive_portal_window_proxy_.reset( |
| 88 new CaptivePortalWindowProxy(&delegate_, web_contents)); | 91 new CaptivePortalWindowProxy(&delegate_, web_contents)); |
| 89 } | 92 } |
| 90 | 93 |
| 91 void TearDownOnMainThread() override { | 94 void TearDownOnMainThread() override { |
| 92 captive_portal_window_proxy_.reset(); | 95 captive_portal_window_proxy_.reset(); |
| 93 base::MessageLoopForUI::current()->DeleteSoon(FROM_HERE, host_); | 96 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, host_); |
| 94 base::MessageLoopForUI::current()->RunUntilIdle(); | 97 base::MessageLoopForUI::current()->RunUntilIdle(); |
| 95 } | 98 } |
| 96 | 99 |
| 97 private: | 100 private: |
| 98 std::unique_ptr<CaptivePortalWindowProxy> captive_portal_window_proxy_; | 101 std::unique_ptr<CaptivePortalWindowProxy> captive_portal_window_proxy_; |
| 99 CaptivePortalWindowProxyStubDelegate delegate_; | 102 CaptivePortalWindowProxyStubDelegate delegate_; |
| 100 | 103 |
| 101 LoginDisplayHost* host_; | 104 LoginDisplayHost* host_; |
| 102 }; | 105 }; |
| 103 | 106 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 227 |
| 225 ASSERT_EQ(PortalDetectorStrategy::STRATEGY_ID_LOGIN_SCREEN, strategy_id()); | 228 ASSERT_EQ(PortalDetectorStrategy::STRATEGY_ID_LOGIN_SCREEN, strategy_id()); |
| 226 network_portal_detector()->NotifyObserversForTesting(); | 229 network_portal_detector()->NotifyObserversForTesting(); |
| 227 OobeScreenWaiter(OobeScreen::SCREEN_ERROR_MESSAGE).Wait(); | 230 OobeScreenWaiter(OobeScreen::SCREEN_ERROR_MESSAGE).Wait(); |
| 228 ASSERT_EQ(PortalDetectorStrategy::STRATEGY_ID_ERROR_SCREEN, strategy_id()); | 231 ASSERT_EQ(PortalDetectorStrategy::STRATEGY_ID_ERROR_SCREEN, strategy_id()); |
| 229 | 232 |
| 230 error_screen->ShowCaptivePortal(); | 233 error_screen->ShowCaptivePortal(); |
| 231 } | 234 } |
| 232 | 235 |
| 233 } // namespace chromeos | 236 } // namespace chromeos |
| OLD | NEW |