| 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/network_device_handler.h" | 5 #include "chromeos/network/network_device_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 virtual void TearDown() OVERRIDE { | 62 virtual void TearDown() OVERRIDE { |
| 63 device_handler_->RemoveObserver(observer_.get()); | 63 device_handler_->RemoveObserver(observer_.get()); |
| 64 observer_.reset(); | 64 observer_.reset(); |
| 65 device_handler_.reset(); | 65 device_handler_.reset(); |
| 66 DBusThreadManager::Shutdown(); | 66 DBusThreadManager::Shutdown(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void AddDevice(const std::string& type, const std::string& id) { | 69 void AddDevice(const std::string& type, const std::string& id) { |
| 70 manager_test_->AddDevice(id); | 70 manager_test_->AddDevice(id); |
| 71 device_test_->AddDevice(id, type, std::string("/device/" + id), "/stub"); | 71 device_test_->AddDevice(id, type, std::string("/device/" + id)); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void RemoveDevice(const std::string& id) { | 74 void RemoveDevice(const std::string& id) { |
| 75 manager_test_->RemoveDevice(id); | 75 manager_test_->RemoveDevice(id); |
| 76 device_test_->RemoveDevice(id); | 76 device_test_->RemoveDevice(id); |
| 77 } | 77 } |
| 78 | 78 |
| 79 // Call this after any initial Shill client setup | 79 // Call this after any initial Shill client setup |
| 80 void SetupNetworkDeviceHandler() { | 80 void SetupNetworkDeviceHandler() { |
| 81 device_handler_.reset(new NetworkDeviceHandler()); | 81 device_handler_.reset(new NetworkDeviceHandler()); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 observer_->devices().size()); | 127 observer_->devices().size()); |
| 128 | 128 |
| 129 // Remove a device | 129 // Remove a device |
| 130 RemoveDevice(kTestDevicePath); | 130 RemoveDevice(kTestDevicePath); |
| 131 message_loop_.RunUntilIdle(); | 131 message_loop_.RunUntilIdle(); |
| 132 EXPECT_EQ(3, observer_->device_updates()); | 132 EXPECT_EQ(3, observer_->device_updates()); |
| 133 EXPECT_EQ(kNumShillManagerClientStubImplDevices, observer_->devices().size()); | 133 EXPECT_EQ(kNumShillManagerClientStubImplDevices, observer_->devices().size()); |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace chromeos | 136 } // namespace chromeos |
| OLD | NEW |