summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
diff options
context:
space:
mode:
authorstanleyw@chromium.org <stanleyw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-04 21:40:42 +0000
committerstanleyw@chromium.org <stanleyw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-04 21:40:42 +0000
commit550c5bcedc53b42a53ddd48fdc2b218864c9bb4a (patch)
treeecacfb1e4a39e061172eb16053ece129f4ade14c /chrome/browser/automation
parent8c6b2c145d66a802b45ef0f396494e4db62da88c (diff)
downloadchromium_src-550c5bcedc53b42a53ddd48fdc2b218864c9bb4a.zip
chromium_src-550c5bcedc53b42a53ddd48fdc2b218864c9bb4a.tar.gz
chromium_src-550c5bcedc53b42a53ddd48fdc2b218864c9bb4a.tar.bz2
Adding sharing networks support for Wifi networks
Encrypted wifi networks should support the option to share or not. Adding sharing option to the ConnectToWifiNetwork and ConnectToHiddenWifiNetwork call. Also, testAddRemoveRememberedNetworks replaced with individual instances of shared/unsared networks. Separate tests will be added for specific scenarios. Change-Id: Ide05accc7d5390f0c66617f25c47173f265d134b BUG=CHROMIUM-OS:22187 TEST= Run pyauto test chromeos_wifi_functional.py Review URL: http://codereview.chromium.org/8341077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108720 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r--chrome/browser/automation/testing_automation_provider_chromeos.cc21
1 files changed, 15 insertions, 6 deletions
diff --git a/chrome/browser/automation/testing_automation_provider_chromeos.cc b/chrome/browser/automation/testing_automation_provider_chromeos.cc
index bdfb531..d74d81d 100644
--- a/chrome/browser/automation/testing_automation_provider_chromeos.cc
+++ b/chrome/browser/automation/testing_automation_provider_chromeos.cc
@@ -613,8 +613,10 @@ void TestingAutomationProvider::ConnectToWifiNetwork(
AutomationJSONReply reply(this, reply_message);
std::string service_path, password;
+ bool shared;
if (!args->GetString("service_path", &service_path) ||
- !args->GetString("password", &password)) {
+ !args->GetString("password", &password) ||
+ !args->GetBoolean("shared", &shared)) {
reply.SendError("Invalid or missing args.");
return;
}
@@ -629,10 +631,15 @@ void TestingAutomationProvider::ConnectToWifiNetwork(
if (!password.empty())
wifi->SetPassphrase(password);
+ // Regardless of what was passed, if the network is open and visible,
+ // the network must be shared because of a UI restriction.
+ if (wifi->encryption() == chromeos::SECURITY_NONE)
+ shared = true;
+
// Set up an observer (it will delete itself).
new ServicePathConnectObserver(this, reply_message, service_path);
- network_library->ConnectToWifiNetwork(wifi);
+ network_library->ConnectToWifiNetwork(wifi, shared);
network_library->RequestNetworkScan();
}
@@ -657,9 +664,11 @@ void TestingAutomationProvider::ConnectToHiddenWifiNetwork(
return;
std::string ssid, security, password;
+ bool shared;
if (!args->GetString("ssid", &ssid) ||
!args->GetString("security", &security) ||
- !args->GetString("password", &password)) {
+ !args->GetString("password", &password) ||
+ !args->GetBoolean("shared", &shared)) {
AutomationJSONReply(this, reply_message).SendError(
"Invalid or missing args.");
return;
@@ -685,15 +694,15 @@ void TestingAutomationProvider::ConnectToHiddenWifiNetwork(
// Set up an observer (it will delete itself).
new SSIDConnectObserver(this, reply_message, ssid);
- const bool shared = true;
- const bool save_credentials = false;
+ bool save_credentials = false;
if (connection_security == chromeos::SECURITY_8021X) {
chromeos::NetworkLibrary::EAPConfigData config_data;
std::string eap_method, eap_auth, eap_identity;
if (!args->GetString("eap_method", &eap_method) ||
!args->GetString("eap_auth", &eap_auth) ||
- !args->GetString("eap_identity", &eap_identity)) {
+ !args->GetString("eap_identity", &eap_identity) ||
+ !args->GetBoolean("save_credentials", &save_credentials)) {
AutomationJSONReply(this, reply_message).SendError(
"Invalid or missing EAP args.");
return;