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

Side by Side Diff: components/wifi/wifi_test.cc

Issue 2082333002: Remove calls to deprecated MessageLoop methods in components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « components/wallpaper/wallpaper_resizer_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 <stdio.h> 5 #include <stdio.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } 197 }
198 198
199 wifi_service_->SetEventObservers( 199 wifi_service_->SetEventObservers(
200 loop.task_runner(), 200 loop.task_runner(),
201 base::Bind(&WiFiTest::OnNetworksChanged, base::Unretained(this)), 201 base::Bind(&WiFiTest::OnNetworksChanged, base::Unretained(this)),
202 base::Bind(&WiFiTest::OnNetworkListChanged, base::Unretained(this))); 202 base::Bind(&WiFiTest::OnNetworkListChanged, base::Unretained(this)));
203 203
204 wifi_service_->StartConnect(network_guid, &error); 204 wifi_service_->StartConnect(network_guid, &error);
205 VLOG(0) << error; 205 VLOG(0) << error;
206 if (error.empty()) 206 if (error.empty())
207 base::MessageLoop::current()->Run(); 207 base::RunLoop().Run();
208 return true; 208 return true;
209 } 209 }
210 } 210 }
211 211
212 if (parsed_command_line.HasSwitch("disconnect")) { 212 if (parsed_command_line.HasSwitch("disconnect")) {
213 if (network_guid.length() > 0) { 213 if (network_guid.length() > 0) {
214 std::string error; 214 std::string error;
215 wifi_service_->StartDisconnect(network_guid, &error); 215 wifi_service_->StartDisconnect(network_guid, &error);
216 VLOG(0) << error; 216 VLOG(0) << error;
217 return true; 217 return true;
218 } 218 }
219 } 219 }
220 220
221 if (parsed_command_line.HasSwitch("get_key")) { 221 if (parsed_command_line.HasSwitch("get_key")) {
222 if (network_guid.length() > 0) { 222 if (network_guid.length() > 0) {
223 std::string error; 223 std::string error;
224 std::string key_data; 224 std::string key_data;
225 wifi_service_->GetKeyFromSystem(network_guid, &key_data, &error); 225 wifi_service_->GetKeyFromSystem(network_guid, &key_data, &error);
226 VLOG(0) << key_data << error; 226 VLOG(0) << key_data << error;
227 return true; 227 return true;
228 } 228 }
229 } 229 }
230 230
231 if (parsed_command_line.HasSwitch("scan")) { 231 if (parsed_command_line.HasSwitch("scan")) {
232 wifi_service_->SetEventObservers( 232 wifi_service_->SetEventObservers(
233 loop.task_runner(), 233 loop.task_runner(),
234 base::Bind(&WiFiTest::OnNetworksChanged, base::Unretained(this)), 234 base::Bind(&WiFiTest::OnNetworksChanged, base::Unretained(this)),
235 base::Bind(&WiFiTest::OnNetworkListChanged, base::Unretained(this))); 235 base::Bind(&WiFiTest::OnNetworkListChanged, base::Unretained(this)));
236 wifi_service_->RequestNetworkScan(); 236 wifi_service_->RequestNetworkScan();
237 base::MessageLoop::current()->Run(); 237 base::RunLoop().Run();
238 return true; 238 return true;
239 } 239 }
240 240
241 if (parsed_command_line.HasSwitch("get_connected_ssid")) { 241 if (parsed_command_line.HasSwitch("get_connected_ssid")) {
242 std::string ssid; 242 std::string ssid;
243 std::string error; 243 std::string error;
244 wifi_service_->GetConnectedNetworkSSID(&ssid, &error); 244 wifi_service_->GetConnectedNetworkSSID(&ssid, &error);
245 if (error.length() > 0) 245 if (error.length() > 0)
246 VLOG(0) << error; 246 VLOG(0) << error;
247 else 247 else
248 VLOG(0) << "Network SSID: " << ssid; 248 VLOG(0) << "Network SSID: " << ssid;
249 return true; 249 return true;
250 } 250 }
251 251
252 return false; 252 return false;
253 } 253 }
254 254
255 } // namespace wifi 255 } // namespace wifi
256 256
257 int main(int argc, const char* argv[]) { 257 int main(int argc, const char* argv[]) {
258 base::CommandLine::Init(argc, argv); 258 base::CommandLine::Init(argc, argv);
259 logging::LoggingSettings settings; 259 logging::LoggingSettings settings;
260 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; 260 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
261 logging::InitLogging(settings); 261 logging::InitLogging(settings);
262 262
263 wifi::WiFiTest wifi_test; 263 wifi::WiFiTest wifi_test;
264 return wifi_test.Main(argc, argv); 264 return wifi_test.Main(argc, argv);
265 } 265 }
OLDNEW
« no previous file with comments | « components/wallpaper/wallpaper_resizer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698