shill: Remove IPConfig/DHCPConfig's dependency on Device.
They care about the device name only so use that instead. This eliminates the
need for some circular dependencies.
BUG=chromium-os:16796
TEST=unit tests
Change-Id: Ibfa4eacac2b04b9311abfb76972aaf032c6013aa
Reviewed-on: http://gerrit.chromium.org/gerrit/2943
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/dhcp_config_unittest.cc b/dhcp_config_unittest.cc
index ce3ca62..3edeeae 100644
--- a/dhcp_config_unittest.cc
+++ b/dhcp_config_unittest.cc
@@ -8,8 +8,6 @@
#include "shill/dhcp_config.h"
#include "shill/dhcp_provider.h"
-#include "shill/mock_control.h"
-#include "shill/mock_device.h"
#include "shill/mock_dhcp_proxy.h"
#include "shill/mock_glib.h"
@@ -29,20 +27,15 @@
class DHCPConfigTest : public Test {
public:
DHCPConfigTest()
- : device_(new MockDevice(&control_interface_,
- NULL,
- NULL,
+ : proxy_(new MockDHCPProxy()),
+ config_(new DHCPConfig(DHCPProvider::GetInstance(),
kDeviceName,
- 0)),
- proxy_(new MockDHCPProxy()),
- config_(new DHCPConfig(DHCPProvider::GetInstance(), device_, &glib_)) {
+ &glib_)) {
config_->proxy_.reset(proxy_); // pass ownership
}
protected:
MockGLib glib_;
- MockControl control_interface_;
- scoped_refptr<MockDevice> device_;
MockDHCPProxy * const proxy_;
DHCPConfigRefPtr config_;
};