Index: chromeos/dbus/fake_shill_manager_client.cc |
diff --git a/chromeos/dbus/fake_shill_manager_client.cc b/chromeos/dbus/fake_shill_manager_client.cc |
index 5b061b24f3f5abb70269e9b349fc9a697a225a70..ca3e9a20d0cd388c669fd5b65696b41c6baeaf82 100644 |
--- a/chromeos/dbus/fake_shill_manager_client.cc |
+++ b/chromeos/dbus/fake_shill_manager_client.cc |
@@ -144,6 +144,7 @@ void FakeShillManagerClient::SetProperty(const std::string& name, |
const base::Value& value, |
const base::Closure& callback, |
const ErrorCallback& error_callback) { |
+ VLOG(2) << "SetProperty: " << name; |
pneubeck (no reviews)
2014/06/04 09:30:27
Just noting that these are ending up in release/pr
stevenjb
2014/06/04 19:49:58
Will switch to DVLOG
|
stub_properties_.SetWithoutPathExpansion(name, value.DeepCopy()); |
CallNotifyObserversPropertyChanged(name); |
base::MessageLoop::current()->PostTask(FROM_HERE, callback); |
@@ -446,6 +447,8 @@ void FakeShillManagerClient::SetManagerProperty(const std::string& key, |
void FakeShillManagerClient::AddManagerService(const std::string& service_path, |
bool add_to_visible_list, |
bool add_to_watch_list) { |
+ VLOG(2) << "AddManagerService: " << service_path |
+ << " Visible: " << add_to_visible_list; |
// Always add to ServiceCompleteListProperty. |
GetListProperty(shill::kServiceCompleteListProperty)->AppendIfNotPresent( |
base::Value::CreateStringValue(service_path)); |
@@ -462,6 +465,7 @@ void FakeShillManagerClient::AddManagerService(const std::string& service_path, |
void FakeShillManagerClient::RemoveManagerService( |
const std::string& service_path, |
bool remove_from_complete_list) { |
+ VLOG(2) << "RemoveManagerService: " << service_path; |
base::StringValue service_path_value(service_path); |
if (remove_from_complete_list) { |
GetListProperty(shill::kServiceCompleteListProperty)->Remove( |
@@ -478,6 +482,7 @@ void FakeShillManagerClient::RemoveManagerService( |
} |
void FakeShillManagerClient::ClearManagerServices() { |
+ VLOG(1) << "ClearManagerServices"; |
GetListProperty(shill::kServiceCompleteListProperty)->Clear(); |
GetListProperty(shill::kServicesProperty)->Clear(); |
GetListProperty(shill::kServiceWatchListProperty)->Clear(); |
@@ -497,6 +502,7 @@ void FakeShillManagerClient::ServiceStateChanged( |
} |
void FakeShillManagerClient::SortManagerServices() { |
+ VLOG(1) << "SortManagerServices"; |
SortServiceList(shill::kServicesProperty); |
SortServiceList(shill::kServiceCompleteListProperty); |
} |
@@ -511,6 +517,7 @@ void FakeShillManagerClient::SortServiceList(const std::string& property) { |
}; |
base::ListValue* service_list = GetListProperty(property); |
+ scoped_ptr<base::ListValue> prev_service_list(service_list->DeepCopy()); |
std::vector<std::string> active_services; |
std::vector<std::string> inactive_services; |
if (service_list && !service_list->empty()) { |
@@ -528,7 +535,8 @@ void FakeShillManagerClient::SortServiceList(const std::string& property) { |
if (property != shill::kServicesProperty) |
return; |
- CallNotifyObserversPropertyChanged(property); |
+ if (!service_list->Equals(prev_service_list.get())) |
+ CallNotifyObserversPropertyChanged(shill::kServicesProperty); |
// Set the first active service as the Default service. |
std::string new_default_service; |
@@ -620,11 +628,11 @@ void FakeShillManagerClient::SetupDefaultEnvironment() { |
devices->SetDeviceProperty("/device/eth1", |
shill::kIPConfigsProperty, |
eth_ip_configs); |
- services->AddService("eth1", "eth1", |
+ services->AddService("/service/eth1", "eth1", |
shill::kTypeEthernet, |
state, |
add_to_visible, add_to_watchlist); |
- profiles->AddService(shared_profile, "eth1"); |
+ profiles->AddService(shared_profile, "/service/eth1"); |
} |
// Wifi |
@@ -647,32 +655,32 @@ void FakeShillManagerClient::SetupDefaultEnvironment() { |
shill::kIPConfigsProperty, |
wifi_ip_configs); |
- services->AddService("wifi1", |
+ services->AddService("/service/wifi1", |
"wifi1", |
shill::kTypeWifi, |
state, |
add_to_visible, add_to_watchlist); |
- services->SetServiceProperty("wifi1", |
+ services->SetServiceProperty("/service/wifi1", |
shill::kSecurityProperty, |
base::StringValue(shill::kSecurityWep)); |
- profiles->AddService(shared_profile, "wifi1"); |
+ profiles->AddService(shared_profile, "/service/wifi1"); |
- services->AddService("wifi2", |
+ services->AddService("/service/wifi2", |
"wifi2_PSK", |
shill::kTypeWifi, |
shill::kStateIdle, |
add_to_visible, add_to_watchlist); |
- services->SetServiceProperty("wifi2", |
+ services->SetServiceProperty("/service/wifi2", |
shill::kSecurityProperty, |
base::StringValue(shill::kSecurityPsk)); |
base::FundamentalValue strength_value(80); |
services->SetServiceProperty( |
- "wifi2", shill::kSignalStrengthProperty, strength_value); |
- profiles->AddService(shared_profile, "wifi2"); |
+ "/service/wifi2", shill::kSignalStrengthProperty, strength_value); |
+ profiles->AddService(shared_profile, "/service/wifi2"); |
if (portaled) { |
- const std::string kPortaledWifiPath = "portaled_wifi"; |
+ const std::string kPortaledWifiPath = "/service/portaled_wifi"; |
services->AddService(kPortaledWifiPath, |
"Portaled Wifi", |
shill::kTypeWifi, |
@@ -698,13 +706,14 @@ void FakeShillManagerClient::SetupDefaultEnvironment() { |
devices->AddDevice( |
"/device/wimax1", shill::kTypeWimax, "stub_wimax_device1"); |
- services->AddService("wimax1", |
+ services->AddService("/service/wimax1", |
"wimax1", |
shill::kTypeWimax, |
state, |
add_to_visible, add_to_watchlist); |
- services->SetServiceProperty( |
- "wimax1", shill::kConnectableProperty, base::FundamentalValue(true)); |
+ services->SetServiceProperty("/service/wimax1", |
+ shill::kConnectableProperty, |
+ base::FundamentalValue(true)); |
} |
// Cellular |
@@ -722,31 +731,32 @@ void FakeShillManagerClient::SetupDefaultEnvironment() { |
shill::kCarrierProperty, |
base::StringValue(shill::kCarrierSprint)); |
- services->AddService("cellular1", |
+ services->AddService("/service/cellular1", |
"cellular1", |
shill::kTypeCellular, |
state, |
add_to_visible, add_to_watchlist); |
base::StringValue technology_value(shill::kNetworkTechnologyGsm); |
- services->SetServiceProperty( |
- "cellular1", shill::kNetworkTechnologyProperty, technology_value); |
+ services->SetServiceProperty("/service/cellular1", |
+ shill::kNetworkTechnologyProperty, |
+ technology_value); |
if (activated) { |
services->SetServiceProperty( |
- "cellular1", |
+ "/service/cellular1", |
shill::kActivationStateProperty, |
base::StringValue(shill::kActivationStateActivated)); |
- services->SetServiceProperty("cellular1", |
+ services->SetServiceProperty("/service/cellular1", |
shill::kConnectableProperty, |
base::FundamentalValue(true)); |
} else { |
services->SetServiceProperty( |
- "cellular1", |
+ "/service/cellular1", |
shill::kActivationStateProperty, |
base::StringValue(shill::kActivationStateNotActivated)); |
} |
- services->SetServiceProperty("cellular1", |
+ services->SetServiceProperty("/service/cellular1", |
shill::kRoamingStateProperty, |
base::StringValue(shill::kRoamingStateHome)); |
} |
@@ -763,22 +773,22 @@ void FakeShillManagerClient::SetupDefaultEnvironment() { |
shill::kProviderOpenVpn); |
provider_properties.SetString(shill::kHostProperty, "vpn_host"); |
- services->AddService("vpn1", |
+ services->AddService("/service/vpn1", |
"vpn1", |
shill::kTypeVPN, |
state, |
add_to_visible, add_to_watchlist); |
services->SetServiceProperty( |
- "vpn1", shill::kProviderProperty, provider_properties); |
- profiles->AddService(shared_profile, "vpn1"); |
+ "/service/vpn1", shill::kProviderProperty, provider_properties); |
+ profiles->AddService(shared_profile, "/service/vpn1"); |
- services->AddService("vpn2", |
+ services->AddService("/service/vpn2", |
"vpn2", |
shill::kTypeVPN, |
shill::kStateIdle, |
add_to_visible, add_to_watchlist); |
services->SetServiceProperty( |
- "vpn2", shill::kProviderProperty, provider_properties); |
+ "/service/vpn2", shill::kProviderProperty, provider_properties); |
} |
SortManagerServices(); |
@@ -831,6 +841,7 @@ void FakeShillManagerClient::CallNotifyObserversPropertyChanged( |
void FakeShillManagerClient::NotifyObserversPropertyChanged( |
const std::string& property) { |
+ VLOG(1) << "NotifyObserversPropertyChanged: " << property; |
if (property == shill::kServicesProperty || |
property == shill::kServiceWatchListProperty) { |
scoped_ptr<base::ListValue> services(GetEnabledServiceList(property)); |
@@ -937,6 +948,7 @@ void FakeShillManagerClient::ScanCompleted(const std::string& device_path, |
shill::kScanningProperty, |
base::FundamentalValue(false)); |
} |
+ VLOG(2) << "ScanCompleted"; |
CallNotifyObserversPropertyChanged(shill::kServicesProperty); |
CallNotifyObserversPropertyChanged(shill::kServiceWatchListProperty); |
base::MessageLoop::current()->PostTask(FROM_HERE, callback); |