summaryrefslogtreecommitdiffstats
path: root/components/wifi/wifi_test.cc
diff options
context:
space:
mode:
authormef@chromium.org <mef@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-17 00:55:34 +0000
committermef@chromium.org <mef@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-17 00:55:34 +0000
commitd58352fa14b0879b1e58875fa88689563884d9ac (patch)
tree2203800341a8fd4628cc518b18af617e2c4e502b /components/wifi/wifi_test.cc
parent8eb75570276f78a373c106910da44da76562b4f8 (diff)
downloadchromium_src-d58352fa14b0879b1e58875fa88689563884d9ac.zip
chromium_src-d58352fa14b0879b1e58875fa88689563884d9ac.tar.gz
chromium_src-d58352fa14b0879b1e58875fa88689563884d9ac.tar.bz2
WiFiService on Win will NotifyNetworkListChanged with empty list when WiFi is disabled.
BUG=385236 TEST=wifi_test --scan (Disable the interface, observe notification). Review URL: https://codereview.chromium.org/336173004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277602 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/wifi/wifi_test.cc')
-rw-r--r--components/wifi/wifi_test.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/components/wifi/wifi_test.cc b/components/wifi/wifi_test.cc
index b0ac3ca..be4ab8d 100644
--- a/components/wifi/wifi_test.cc
+++ b/components/wifi/wifi_test.cc
@@ -89,6 +89,7 @@ WiFiTest::Result WiFiTest::Main(int argc, const char* argv[]) {
" [--create]"
" [--connect]"
" [--disconnect]"
+ " [--scan]"
" [--network_guid=<network_guid>]"
" [--frequency=0|2400|5000]"
" [--security=none|WEP-PSK|WPA-PSK|WPA2-PSK]"
@@ -220,6 +221,16 @@ bool WiFiTest::ParseCommandLine(int argc, const char* argv[]) {
}
}
+ if (parsed_command_line.HasSwitch("scan")) {
+ wifi_service_->SetEventObservers(
+ loop.message_loop_proxy(),
+ base::Bind(&WiFiTest::OnNetworksChanged, base::Unretained(this)),
+ base::Bind(&WiFiTest::OnNetworkListChanged, base::Unretained(this)));
+ wifi_service_->RequestNetworkScan();
+ base::MessageLoop::current()->Run();
+ return true;
+ }
+
return false;
}