Index: components/wifi/wifi_test.cc |
diff --git a/components/wifi/wifi_test.cc b/components/wifi/wifi_test.cc |
index 8fd0aaf9deaee427573166f251d95e046770b9f7..459d90140d6e84e0622b118025560cb77f2d76be 100644 |
--- a/components/wifi/wifi_test.cc |
+++ b/components/wifi/wifi_test.cc |
@@ -88,6 +88,8 @@ bool WiFiTest::ParseCommandLine(int argc, const char* argv[]) { |
const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
std::string network_guid = |
parsed_command_line.GetSwitchValueASCII("network_guid"); |
+ std::string frequency = |
+ parsed_command_line.GetSwitchValueASCII("frequency"); |
if (parsed_command_line.GetArgs().size() == 1) { |
#if defined(OS_WIN) |
@@ -127,9 +129,28 @@ bool WiFiTest::ParseCommandLine(int argc, const char* argv[]) { |
} |
} |
+ // Optional properties (frequency, password) to use for connect. |
+ scoped_ptr<DictionaryValue> connect_properties(new DictionaryValue()); |
+ |
+ if (parsed_command_line.HasSwitch("frequency")) { |
+ int value = 0; |
+ if (!network_guid.empty() && |
+ !frequency.empty() && |
+ base::StringToInt(frequency, &value)) { |
+ connect_properties->SetInteger("WiFi.Frequency", value); |
+ // fall through to connect. |
+ } |
+ } |
+ |
if (parsed_command_line.HasSwitch("connect")) { |
if (network_guid.length() > 0) { |
std::string error; |
+ if (!connect_properties->empty()) { |
+ std::cout << "Using connect properties: " << *connect_properties; |
+ wifi_service->SetProperties(network_guid, |
+ connect_properties.Pass(), |
+ &error); |
+ } |
wifi_service->StartConnect(network_guid, &error); |
std::cout << error; |
return true; |