Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: chrome/browser/chromeos/login/ui/captive_portal_window_browsertest.cc

Issue 872633008: Migrate (Network)ErrorScreen to ScreenContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "chrome/browser/chromeos/login/screens/network_error_view.h"
10 #include "chrome/browser/chromeos/login/startup_utils.h" 12 #include "chrome/browser/chromeos/login/startup_utils.h"
11 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" 13 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h"
12 #include "chrome/browser/chromeos/login/ui/captive_portal_window_proxy.h" 14 #include "chrome/browser/chromeos/login/ui/captive_portal_window_proxy.h"
13 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" 15 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
14 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" 16 #include "chrome/browser/chromeos/login/ui/webui_login_view.h"
15 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" 17 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h"
16 #include "chrome/test/base/in_process_browser_test.h" 18 #include "chrome/test/base/in_process_browser_test.h"
17 #include "chromeos/chromeos_switches.h" 19 #include "chromeos/chromeos_switches.h"
18 #include "chromeos/dbus/fake_shill_manager_client.h" 20 #include "chromeos/dbus/fake_shill_manager_client.h"
19 #include "chromeos/network/portal_detector/network_portal_detector.h" 21 #include "chromeos/network/portal_detector/network_portal_detector.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 IN_PROC_BROWSER_TEST_F(CaptivePortalWindowCtorDtorTest, PRE_OpenPortalDialog) { 211 IN_PROC_BROWSER_TEST_F(CaptivePortalWindowCtorDtorTest, PRE_OpenPortalDialog) {
210 StartupUtils::MarkOobeCompleted(); 212 StartupUtils::MarkOobeCompleted();
211 } 213 }
212 214
213 IN_PROC_BROWSER_TEST_F(CaptivePortalWindowCtorDtorTest, OpenPortalDialog) { 215 IN_PROC_BROWSER_TEST_F(CaptivePortalWindowCtorDtorTest, OpenPortalDialog) {
214 LoginDisplayHostImpl* host = 216 LoginDisplayHostImpl* host =
215 static_cast<LoginDisplayHostImpl*>(LoginDisplayHostImpl::default_host()); 217 static_cast<LoginDisplayHostImpl*>(LoginDisplayHostImpl::default_host());
216 ASSERT_TRUE(host); 218 ASSERT_TRUE(host);
217 OobeUI* oobe = host->GetOobeUI(); 219 OobeUI* oobe = host->GetOobeUI();
218 ASSERT_TRUE(oobe); 220 ASSERT_TRUE(oobe);
219 ErrorScreenActor* actor = oobe->GetErrorScreenActor(); 221 NetworkErrorView* network_error_view = oobe->GetNetworkErrorView();
220 ASSERT_TRUE(actor); 222 ASSERT_TRUE(network_error_view);
221 223
222 // Error screen asks portal detector to change detection strategy. 224 // Error screen asks portal detector to change detection strategy.
223 ErrorScreen error_screen(NULL, actor); 225 ErrorScreen error_screen(NULL, network_error_view);
224 226
225 ASSERT_EQ(PortalDetectorStrategy::STRATEGY_ID_LOGIN_SCREEN, strategy_id()); 227 ASSERT_EQ(PortalDetectorStrategy::STRATEGY_ID_LOGIN_SCREEN, strategy_id());
226 network_portal_detector()->NotifyObserversForTesting(); 228 network_portal_detector()->NotifyObserversForTesting();
227 OobeScreenWaiter(OobeDisplay::SCREEN_ERROR_MESSAGE).Wait(); 229 OobeScreenWaiter(OobeDisplay::SCREEN_ERROR_MESSAGE).Wait();
228 ASSERT_EQ(PortalDetectorStrategy::STRATEGY_ID_ERROR_SCREEN, strategy_id()); 230 ASSERT_EQ(PortalDetectorStrategy::STRATEGY_ID_ERROR_SCREEN, strategy_id());
229 231
230 actor->ShowCaptivePortal(); 232 error_screen.ShowCaptivePortal();
231 } 233 }
232 234
233 } // namespace chromeos 235 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698