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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 void FakeShillDeviceClient::AddDevice(const std::string& device_path, | 239 void FakeShillDeviceClient::AddDevice(const std::string& device_path, |
240 const std::string& type, | 240 const std::string& type, |
241 const std::string& object_path) { | 241 const std::string& object_path) { |
242 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> | 242 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> |
243 AddDevice(device_path); | 243 AddDevice(device_path); |
244 | 244 |
245 base::DictionaryValue* properties = GetDeviceProperties(device_path); | 245 base::DictionaryValue* properties = GetDeviceProperties(device_path); |
246 properties->SetWithoutPathExpansion(shill::kTypeProperty, | 246 properties->SetWithoutPathExpansion(shill::kTypeProperty, |
247 base::Value::CreateStringValue(type)); | 247 base::Value::CreateStringValue(type)); |
248 properties->SetWithoutPathExpansion( | 248 properties->SetWithoutPathExpansion( |
| 249 shill::kNameProperty, |
| 250 base::Value::CreateStringValue(object_path)); |
| 251 properties->SetWithoutPathExpansion( |
249 shill::kDBusObjectProperty, base::Value::CreateStringValue(object_path)); | 252 shill::kDBusObjectProperty, base::Value::CreateStringValue(object_path)); |
250 properties->SetWithoutPathExpansion( | 253 properties->SetWithoutPathExpansion( |
251 shill::kDBusServiceProperty, | 254 shill::kDBusServiceProperty, |
252 base::Value::CreateStringValue(modemmanager::kModemManager1ServiceName)); | 255 base::Value::CreateStringValue(modemmanager::kModemManager1ServiceName)); |
253 if (NetworkTypePattern::Cellular().MatchesType(type)) { | 256 if (NetworkTypePattern::Cellular().MatchesType(type)) { |
254 properties->SetWithoutPathExpansion(shill::kCellularAllowRoamingProperty, | 257 properties->SetWithoutPathExpansion(shill::kCellularAllowRoamingProperty, |
255 new base::FundamentalValue(false)); | 258 new base::FundamentalValue(false)); |
256 } | 259 } |
257 } | 260 } |
258 | 261 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 std::map<dbus::ObjectPath, PropertyObserverList*>::iterator iter = | 357 std::map<dbus::ObjectPath, PropertyObserverList*>::iterator iter = |
355 observer_list_.find(device_path); | 358 observer_list_.find(device_path); |
356 if (iter != observer_list_.end()) | 359 if (iter != observer_list_.end()) |
357 return *(iter->second); | 360 return *(iter->second); |
358 PropertyObserverList* observer_list = new PropertyObserverList(); | 361 PropertyObserverList* observer_list = new PropertyObserverList(); |
359 observer_list_[device_path] = observer_list; | 362 observer_list_[device_path] = observer_list; |
360 return *observer_list; | 363 return *observer_list; |
361 } | 364 } |
362 | 365 |
363 } // namespace chromeos | 366 } // namespace chromeos |
OLD | NEW |