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

Unified Diff: components/wifi/wifi_test.cc

Issue 64683014: Mac OS X-specific implementation of Networking Private API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Made networkingPrivateApi available on OS X. Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/wifi/wifi_service_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/wifi/wifi_test.cc
diff --git a/components/wifi/wifi_test.cc b/components/wifi/wifi_test.cc
index 8fd0aaf9deaee427573166f251d95e046770b9f7..4191dc76e13c103ec6207bb390ff4f571fc90ea3 100644
--- a/components/wifi/wifi_test.cc
+++ b/components/wifi/wifi_test.cc
@@ -72,6 +72,7 @@ WiFiTest::Result WiFiTest::Main(int argc, const char* argv[]) {
" [--disconnect]"
" [--network_guid=<network_guid>]"
" [--frequency=0|2400|5000]"
+ " [--password=<password>]"
" [<network_guid>]\n",
argv[0]);
return RESULT_WRONG_USAGE;
@@ -88,6 +89,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 password =
+ parsed_command_line.GetSwitchValueASCII("password");
if (parsed_command_line.GetArgs().size() == 1) {
#if defined(OS_WIN)
@@ -102,7 +105,7 @@ bool WiFiTest::ParseCommandLine(int argc, const char* argv[]) {
MessageBoxA(NULL, __FUNCTION__, "Debug Me!", MB_OK);
#endif
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(OS_MACOSX)
scoped_ptr<WiFiService> wifi_service(WiFiService::Create());
#else
scoped_ptr<WiFiService> wifi_service(WiFiService::CreateForTest());
@@ -127,6 +130,16 @@ bool WiFiTest::ParseCommandLine(int argc, const char* argv[]) {
}
}
+ if (parsed_command_line.HasSwitch("password")) {
+ if (network_guid.length() > 0) {
+ std::string error;
+ scoped_ptr<DictionaryValue> properties(new DictionaryValue());
+ properties->SetString("WiFi.Passphrase", password);
+ wifi_service->SetProperties(network_guid, properties.Pass(), &error);
+ // fall through to connect.
+ }
+ }
+
if (parsed_command_line.HasSwitch("connect")) {
if (network_guid.length() > 0) {
std::string error;
« no previous file with comments | « components/wifi/wifi_service_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698