Chromium Code Reviews| Index: chromeos/dbus/shill_service_client_stub.cc |
| diff --git a/chromeos/dbus/shill_service_client_stub.cc b/chromeos/dbus/shill_service_client_stub.cc |
| index 86e637b196e44496dbc0f9b1339b4f7b027afd81..9267c049d46c78b7de745312af260b666bfb2751 100644 |
| --- a/chromeos/dbus/shill_service_client_stub.cc |
| +++ b/chromeos/dbus/shill_service_client_stub.cc |
| @@ -78,7 +78,7 @@ void ShillServiceClientStub::SetProperty(const dbus::ObjectPath& service_path, |
| base::DictionaryValue* dict = NULL; |
| if (!stub_services_.GetDictionaryWithoutPathExpansion( |
| service_path.value(), &dict)) { |
| - error_callback.Run("StubError", "Service not found"); |
| + error_callback.Run("Error.InvalidService", "Invalid Service"); |
| return; |
| } |
| if (name == flimflam::kStateProperty) { |
| @@ -111,7 +111,7 @@ void ShillServiceClientStub::ClearProperty( |
| base::DictionaryValue* dict = NULL; |
| if (!stub_services_.GetDictionaryWithoutPathExpansion( |
| service_path.value(), &dict)) { |
| - error_callback.Run("StubError", "Service not found"); |
| + error_callback.Run("Error.InvalidService", "Invalid Service"); |
| return; |
| } |
| dict->Remove(name, NULL); |
| @@ -132,7 +132,7 @@ void ShillServiceClientStub::ClearProperties( |
| base::DictionaryValue* dict = NULL; |
| if (!stub_services_.GetDictionaryWithoutPathExpansion( |
| service_path.value(), &dict)) { |
| - error_callback.Run("StubError", "Service not found"); |
| + error_callback.Run("Error.InvalidService", "Invalid Service"); |
| return; |
| } |
| scoped_ptr<base::ListValue> results(new base::ListValue); |
| @@ -189,6 +189,11 @@ void ShillServiceClientStub::Connect(const dbus::ObjectPath& service_path, |
| void ShillServiceClientStub::Disconnect(const dbus::ObjectPath& service_path, |
| const base::Closure& callback, |
| const ErrorCallback& error_callback) { |
| + base::Value* service; |
| + if (!stub_services_.Get(service_path.value(), &service)) { |
| + error_callback.Run("Error.InvalidService", "Invalid Service"); |
| + return; |
| + } |
| // Set Idle after a delay |
| const int kConnectDelaySeconds = 2; |
| base::StringValue idle_value(flimflam::kStateIdle); |
| @@ -309,15 +314,17 @@ void ShillServiceClientStub::SetDefaultProperties() { |
| flimflam::kTypeWifi, |
| flimflam::kStateOnline, |
| add_to_watchlist); |
| + SetServiceProperty("stub_wifi1", |
| + flimflam::kSecurityProperty, |
| + base::StringValue(flimflam::kSecurityWep)); |
| AddService("stub_wifi2", "wifi2_PSK", |
| flimflam::kTypeWifi, |
| flimflam::kStateIdle, |
| add_to_watchlist); |
| - base::StringValue psk_value(flimflam::kSecurityPsk); |
| SetServiceProperty("stub_wifi2", |
| flimflam::kSecurityProperty, |
| - psk_value); |
| + base::StringValue(flimflam::kSecurityPsk)); |
| base::FundamentalValue strength_value(80); |
| SetServiceProperty("stub_wifi2", |
| flimflam::kSignalStrengthProperty, |
| @@ -331,10 +338,12 @@ void ShillServiceClientStub::SetDefaultProperties() { |
| SetServiceProperty("stub_cellular1", |
| flimflam::kNetworkTechnologyProperty, |
| technology_value); |
| - base::StringValue activation_value(flimflam::kActivationStateActivated); |
| SetServiceProperty("stub_cellular1", |
| flimflam::kActivationStateProperty, |
| - activation_value); |
| + base::StringValue(flimflam::kActivationStateNotActivated)); |
| + SetServiceProperty("stub_cellular1", |
| + flimflam::kRoamingStateProperty, |
| + base::StringValue(flimflam::kRoamingStateHome)); |
|
stevenjb
2013/03/05 17:59:18
These changes are fine, but don't rely on them for
pneubeck (no reviews)
2013/03/07 15:53:02
Done after that CL was committed.
|
| } |
| void ShillServiceClientStub::PassStubServiceProperties( |