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

Side by Side Diff: chrome/browser/chromeos/login/oobe_base_test.cc

Issue 242483003: Move CaptivePortalDetector to src/components/captive_portal (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move CaptivePortalDetector to a component Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
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 "chrome/browser/chromeos/login/oobe_base_test.h" 5 #include "chrome/browser/chromeos/login/oobe_base_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 GURL gaia_url = server_url.ReplaceComponents(replace_gaia_host); 106 GURL gaia_url = server_url.ReplaceComponents(replace_gaia_host);
107 command_line->AppendSwitchASCII(::switches::kGaiaUrl, gaia_url.spec()); 107 command_line->AppendSwitchASCII(::switches::kGaiaUrl, gaia_url.spec());
108 command_line->AppendSwitchASCII(::switches::kLsoUrl, gaia_url.spec()); 108 command_line->AppendSwitchASCII(::switches::kLsoUrl, gaia_url.spec());
109 command_line->AppendSwitchASCII(::switches::kGoogleApisUrl, 109 command_line->AppendSwitchASCII(::switches::kGoogleApisUrl,
110 gaia_url.spec()); 110 gaia_url.spec());
111 fake_gaia_->Initialize(); 111 fake_gaia_->Initialize();
112 } 112 }
113 113
114 void OobeBaseTest::SimulateNetworkOffline() { 114 void OobeBaseTest::SimulateNetworkOffline() {
115 NetworkPortalDetector::CaptivePortalState offline_state; 115 NetworkPortalDetector::CaptivePortalState offline_state;
116 offline_state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE; 116 offline_state.status = captive_portal::CAPTIVE_PORTAL_STATUS_OFFLINE;
117 network_portal_detector_->SetDetectionResultsForTesting( 117 network_portal_detector_->SetDetectionResultsForTesting(
118 kStubEthernetServicePath, offline_state); 118 kStubEthernetServicePath, offline_state);
119 network_portal_detector_->NotifyObserversForTesting(); 119 network_portal_detector_->NotifyObserversForTesting();
120 } 120 }
121 121
122 base::Closure OobeBaseTest::SimulateNetworkOfflineClosure() { 122 base::Closure OobeBaseTest::SimulateNetworkOfflineClosure() {
123 return base::Bind(&OobeBaseTest::SimulateNetworkOffline, 123 return base::Bind(&OobeBaseTest::SimulateNetworkOffline,
124 base::Unretained(this)); 124 base::Unretained(this));
125 } 125 }
126 126
127 void OobeBaseTest::SimulateNetworkOnline() { 127 void OobeBaseTest::SimulateNetworkOnline() {
128 NetworkPortalDetector::CaptivePortalState online_state; 128 NetworkPortalDetector::CaptivePortalState online_state;
129 online_state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE; 129 online_state.status = captive_portal::CAPTIVE_PORTAL_STATUS_ONLINE;
130 online_state.response_code = 204; 130 online_state.response_code = 204;
131 network_portal_detector_->SetDetectionResultsForTesting( 131 network_portal_detector_->SetDetectionResultsForTesting(
132 kStubEthernetServicePath, online_state); 132 kStubEthernetServicePath, online_state);
133 network_portal_detector_->NotifyObserversForTesting(); 133 network_portal_detector_->NotifyObserversForTesting();
134 } 134 }
135 135
136 base::Closure OobeBaseTest::SimulateNetworkOnlineClosure() { 136 base::Closure OobeBaseTest::SimulateNetworkOnlineClosure() {
137 return base::Bind(&OobeBaseTest::SimulateNetworkOnline, 137 return base::Bind(&OobeBaseTest::SimulateNetworkOnline,
138 base::Unretained(this)); 138 base::Unretained(this));
139 } 139 }
140 140
141 void OobeBaseTest::SimulateNetworkPortal() { 141 void OobeBaseTest::SimulateNetworkPortal() {
142 NetworkPortalDetector::CaptivePortalState portal_state; 142 NetworkPortalDetector::CaptivePortalState portal_state;
143 portal_state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL; 143 portal_state.status = captive_portal::CAPTIVE_PORTAL_STATUS_PORTAL;
144 network_portal_detector_->SetDetectionResultsForTesting( 144 network_portal_detector_->SetDetectionResultsForTesting(
145 kStubEthernetServicePath, portal_state); 145 kStubEthernetServicePath, portal_state);
146 network_portal_detector_->NotifyObserversForTesting(); 146 network_portal_detector_->NotifyObserversForTesting();
147 } 147 }
148 148
149 base::Closure OobeBaseTest::SimulateNetworkPortalClosure() { 149 base::Closure OobeBaseTest::SimulateNetworkPortalClosure() {
150 return base::Bind(&OobeBaseTest::SimulateNetworkPortal, 150 return base::Bind(&OobeBaseTest::SimulateNetworkPortal,
151 base::Unretained(this)); 151 base::Unretained(this));
152 } 152 }
153 153
(...skipping 20 matching lines...) Expand all
174 174
175 WebUILoginDisplay* OobeBaseTest::GetLoginDisplay() { 175 WebUILoginDisplay* OobeBaseTest::GetLoginDisplay() {
176 ExistingUserController* controller = 176 ExistingUserController* controller =
177 ExistingUserController::current_controller(); 177 ExistingUserController::current_controller();
178 CHECK(controller); 178 CHECK(controller);
179 return static_cast<WebUILoginDisplay*>( 179 return static_cast<WebUILoginDisplay*>(
180 controller->login_display()); 180 controller->login_display());
181 } 181 }
182 182
183 } // namespace chromeos 183 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698