| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/network/shill_property_handler.h" | 5 #include "chromeos/network/shill_property_handler.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 } | 160 } |
| 161 | 161 |
| 162 virtual void TearDown() OVERRIDE { | 162 virtual void TearDown() OVERRIDE { |
| 163 shill_property_handler_.reset(); | 163 shill_property_handler_.reset(); |
| 164 listener_.reset(); | 164 listener_.reset(); |
| 165 DBusThreadManager::Shutdown(); | 165 DBusThreadManager::Shutdown(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void AddDevice(const std::string& type, const std::string& id) { | 168 void AddDevice(const std::string& type, const std::string& id) { |
| 169 ASSERT_TRUE(IsValidType(type)); | 169 ASSERT_TRUE(IsValidType(type)); |
| 170 manager_test_->AddDevice(id); | |
| 171 device_test_->AddDevice(id, type, std::string("/device/" + id)); | 170 device_test_->AddDevice(id, type, std::string("/device/" + id)); |
| 172 } | 171 } |
| 173 | 172 |
| 174 void RemoveDevice(const std::string& id) { | 173 void RemoveDevice(const std::string& id) { |
| 175 manager_test_->RemoveDevice(id); | |
| 176 device_test_->RemoveDevice(id); | 174 device_test_->RemoveDevice(id); |
| 177 } | 175 } |
| 178 | 176 |
| 179 void AddService(const std::string& type, | 177 void AddService(const std::string& type, |
| 180 const std::string& id, | 178 const std::string& id, |
| 181 const std::string& state, | 179 const std::string& state, |
| 182 bool add_to_watch_list) { | 180 bool add_to_watch_list) { |
| 183 ASSERT_TRUE(IsValidType(type)); | 181 ASSERT_TRUE(IsValidType(type)); |
| 184 manager_test_->AddService(id, add_to_watch_list); | 182 service_test_->AddService(id, id, type, state, add_to_watch_list); |
| 185 service_test_->AddService(id, id, type, state); | |
| 186 } | 183 } |
| 187 | 184 |
| 188 void RemoveService(const std::string& id) { | 185 void RemoveService(const std::string& id) { |
| 189 manager_test_->RemoveService(id); | |
| 190 service_test_->RemoveService(id); | 186 service_test_->RemoveService(id); |
| 191 } | 187 } |
| 192 | 188 |
| 193 // Call this after any initial Shill client setup | 189 // Call this after any initial Shill client setup |
| 194 void SetupShillPropertyHandler() { | 190 void SetupShillPropertyHandler() { |
| 195 listener_.reset(new TestListener); | 191 listener_.reset(new TestListener); |
| 196 shill_property_handler_.reset( | 192 shill_property_handler_.reset( |
| 197 new internal::ShillPropertyHandler(listener_.get())); | 193 new internal::ShillPropertyHandler(listener_.get())); |
| 198 shill_property_handler_->Init(); | 194 shill_property_handler_->Init(); |
| 199 } | 195 } |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 EXPECT_EQ(3, listener_->list_updates(flimflam::kServicesProperty)); | 351 EXPECT_EQ(3, listener_->list_updates(flimflam::kServicesProperty)); |
| 356 EXPECT_EQ(kNumShillManagerClientStubImplServices, | 352 EXPECT_EQ(kNumShillManagerClientStubImplServices, |
| 357 listener_->entries(flimflam::kServicesProperty).size()); | 353 listener_->entries(flimflam::kServicesProperty).size()); |
| 358 | 354 |
| 359 EXPECT_EQ(0, listener_->errors()); | 355 EXPECT_EQ(0, listener_->errors()); |
| 360 } | 356 } |
| 361 | 357 |
| 362 // TODO(stevenjb): Test IP Configs. | 358 // TODO(stevenjb): Test IP Configs. |
| 363 | 359 |
| 364 } // namespace chromeos | 360 } // namespace chromeos |
| OLD | NEW |