| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chromeos/dbus/fake_shill_device_client.h" | 5 #include "chromeos/dbus/fake_shill_device_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 235 |
| 236 // ShillDeviceClient::TestInterface overrides. | 236 // ShillDeviceClient::TestInterface overrides. |
| 237 | 237 |
| 238 void FakeShillDeviceClient::AddDevice(const std::string& device_path, | 238 void FakeShillDeviceClient::AddDevice(const std::string& device_path, |
| 239 const std::string& type, | 239 const std::string& type, |
| 240 const std::string& name) { | 240 const std::string& name) { |
| 241 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> | 241 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> |
| 242 AddDevice(device_path); | 242 AddDevice(device_path); |
| 243 | 243 |
| 244 base::DictionaryValue* properties = GetDeviceProperties(device_path); | 244 base::DictionaryValue* properties = GetDeviceProperties(device_path); |
| 245 properties->SetWithoutPathExpansion(shill::kTypeProperty, | 245 properties->SetStringWithoutPathExpansion(shill::kTypeProperty, type); |
| 246 base::Value::CreateStringValue(type)); | 246 properties->SetStringWithoutPathExpansion(shill::kNameProperty, name); |
| 247 properties->SetWithoutPathExpansion(shill::kNameProperty, | 247 properties->SetStringWithoutPathExpansion(shill::kDBusObjectProperty, |
| 248 base::Value::CreateStringValue(name)); | 248 device_path); |
| 249 properties->SetWithoutPathExpansion( | 249 properties->SetStringWithoutPathExpansion( |
| 250 shill::kDBusObjectProperty, base::Value::CreateStringValue(device_path)); | 250 shill::kDBusServiceProperty, modemmanager::kModemManager1ServiceName); |
| 251 properties->SetWithoutPathExpansion( | |
| 252 shill::kDBusServiceProperty, | |
| 253 base::Value::CreateStringValue(modemmanager::kModemManager1ServiceName)); | |
| 254 if (type == shill::kTypeCellular) { | 251 if (type == shill::kTypeCellular) { |
| 255 properties->SetWithoutPathExpansion(shill::kCellularAllowRoamingProperty, | 252 properties->SetBooleanWithoutPathExpansion( |
| 256 new base::FundamentalValue(false)); | 253 shill::kCellularAllowRoamingProperty, false); |
| 257 } | 254 } |
| 258 } | 255 } |
| 259 | 256 |
| 260 void FakeShillDeviceClient::RemoveDevice(const std::string& device_path) { | 257 void FakeShillDeviceClient::RemoveDevice(const std::string& device_path) { |
| 261 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> | 258 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> |
| 262 RemoveDevice(device_path); | 259 RemoveDevice(device_path); |
| 263 | 260 |
| 264 stub_devices_.RemoveWithoutPathExpansion(device_path, NULL); | 261 stub_devices_.RemoveWithoutPathExpansion(device_path, NULL); |
| 265 } | 262 } |
| 266 | 263 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 std::map<dbus::ObjectPath, PropertyObserverList*>::iterator iter = | 352 std::map<dbus::ObjectPath, PropertyObserverList*>::iterator iter = |
| 356 observer_list_.find(device_path); | 353 observer_list_.find(device_path); |
| 357 if (iter != observer_list_.end()) | 354 if (iter != observer_list_.end()) |
| 358 return *(iter->second); | 355 return *(iter->second); |
| 359 PropertyObserverList* observer_list = new PropertyObserverList(); | 356 PropertyObserverList* observer_list = new PropertyObserverList(); |
| 360 observer_list_[device_path] = observer_list; | 357 observer_list_[device_path] = observer_list; |
| 361 return *observer_list; | 358 return *observer_list; |
| 362 } | 359 } |
| 363 | 360 |
| 364 } // namespace chromeos | 361 } // namespace chromeos |
| OLD | NEW |