| Index: components/wifi/wifi_test.cc
|
| diff --git a/components/wifi/wifi_test.cc b/components/wifi/wifi_test.cc
|
| index 8fd0aaf9deaee427573166f251d95e046770b9f7..9d15802bece97070952ffc9eef07372ca09783bc 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)
|
| @@ -112,7 +114,7 @@ bool WiFiTest::ParseCommandLine(int argc, const char* argv[]) {
|
|
|
| if (parsed_command_line.HasSwitch("list")) {
|
| ListValue network_list;
|
| - wifi_service->GetVisibleNetworks(&network_list);
|
| + wifi_service->GetVisibleNetworks(std::string(), &network_list);
|
| std::cout << network_list;
|
| return true;
|
| }
|
| @@ -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;
|
|
|