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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/chromeos/login/login_manager_test.h" | 9 #include "chrome/browser/chromeos/login/login_manager_test.h" |
10 #include "chrome/browser/chromeos/login/screens/error_screen.h" | 10 #include "chrome/browser/chromeos/login/screens/error_screen.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 IN_PROC_BROWSER_TEST_F(CaptivePortalWindowCtorDtorTest, PRE_OpenPortalDialog) { | 211 IN_PROC_BROWSER_TEST_F(CaptivePortalWindowCtorDtorTest, PRE_OpenPortalDialog) { |
212 StartupUtils::MarkOobeCompleted(); | 212 StartupUtils::MarkOobeCompleted(); |
213 } | 213 } |
214 | 214 |
215 IN_PROC_BROWSER_TEST_F(CaptivePortalWindowCtorDtorTest, OpenPortalDialog) { | 215 IN_PROC_BROWSER_TEST_F(CaptivePortalWindowCtorDtorTest, OpenPortalDialog) { |
216 LoginDisplayHostImpl* host = | 216 LoginDisplayHostImpl* host = |
217 static_cast<LoginDisplayHostImpl*>(LoginDisplayHostImpl::default_host()); | 217 static_cast<LoginDisplayHostImpl*>(LoginDisplayHostImpl::default_host()); |
218 ASSERT_TRUE(host); | 218 ASSERT_TRUE(host); |
219 OobeUI* oobe = host->GetOobeUI(); | 219 OobeUI* oobe = host->GetOobeUI(); |
220 ASSERT_TRUE(oobe); | 220 ASSERT_TRUE(oobe); |
221 NetworkErrorView* network_error_view = oobe->GetNetworkErrorView(); | |
222 ASSERT_TRUE(network_error_view); | |
223 | 221 |
224 // Error screen asks portal detector to change detection strategy. | 222 // Error screen asks portal detector to change detection strategy. |
225 ErrorScreen error_screen(NULL, network_error_view); | 223 ErrorScreen* error_screen = oobe->GetErrorScreen(); |
| 224 ASSERT_TRUE(error_screen); |
226 | 225 |
227 ASSERT_EQ(PortalDetectorStrategy::STRATEGY_ID_LOGIN_SCREEN, strategy_id()); | 226 ASSERT_EQ(PortalDetectorStrategy::STRATEGY_ID_LOGIN_SCREEN, strategy_id()); |
228 network_portal_detector()->NotifyObserversForTesting(); | 227 network_portal_detector()->NotifyObserversForTesting(); |
229 OobeScreenWaiter(OobeDisplay::SCREEN_ERROR_MESSAGE).Wait(); | 228 OobeScreenWaiter(OobeDisplay::SCREEN_ERROR_MESSAGE).Wait(); |
230 ASSERT_EQ(PortalDetectorStrategy::STRATEGY_ID_ERROR_SCREEN, strategy_id()); | 229 ASSERT_EQ(PortalDetectorStrategy::STRATEGY_ID_ERROR_SCREEN, strategy_id()); |
231 | 230 |
232 error_screen.ShowCaptivePortal(); | 231 error_screen->ShowCaptivePortal(); |
233 } | 232 } |
234 | 233 |
235 } // namespace chromeos | 234 } // namespace chromeos |
OLD | NEW |