shill: DHCPConfig: Remove use of minimal config
This reverts commit 397f1892a0f1042fba4b3d8e8fa5d57569deaab1,
but retains the DHCPArgs matcher in dhcp_config_unittest.cc.
BUG=chromium:360452
TEST=Unit tests
Change-Id: I18ab78a8e9e66a102a910a7116e80598a2892944
Reviewed-on: https://chromium-review.googlesource.com/205589
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
diff --git a/cellular_unittest.cc b/cellular_unittest.cc
index eb41544..add3437 100644
--- a/cellular_unittest.cc
+++ b/cellular_unittest.cc
@@ -745,7 +745,7 @@
device_->set_modem_state(Cellular::kModemStateConnected);
device_->set_meid(kMEID);
ExpectCdmaStartModem(kNetworkTechnologyEvdo);
- EXPECT_CALL(dhcp_provider_, CreateConfig(kTestDeviceName, _, _, _, _))
+ EXPECT_CALL(dhcp_provider_, CreateConfig(kTestDeviceName, _, _, _))
.WillOnce(Return(dhcp_config_));
EXPECT_CALL(*dhcp_config_, RequestIP()).WillOnce(Return(true));
EXPECT_CALL(*modem_info_.mock_manager(), UpdateService(_)).Times(3);
@@ -1254,7 +1254,7 @@
}
TEST_F(CellularTest, UseNoArpGateway) {
- EXPECT_CALL(dhcp_provider_, CreateConfig(kTestDeviceName, _, _, false, false))
+ EXPECT_CALL(dhcp_provider_, CreateConfig(kTestDeviceName, _, _, false))
.WillOnce(Return(dhcp_config_));
device_->AcquireIPConfig();
}
@@ -1442,7 +1442,7 @@
EXPECT_CALL(*mock_task, OnDelete()).Times(AnyNumber());
device_->ppp_task_ = mock_task.Pass();
device_->state_ = Cellular::kStateConnected;
- EXPECT_CALL(dhcp_provider_, CreateConfig(kTestDeviceName, _, _, _, _))
+ EXPECT_CALL(dhcp_provider_, CreateConfig(kTestDeviceName, _, _, _))
.Times(0);
EXPECT_CALL(*dhcp_config_, RequestIP()).Times(0);
device_->LinkEvent(IFF_UP, 0);
@@ -1451,7 +1451,7 @@
TEST_F(CellularTest, LinkEventUpWithoutPPP) {
// If PPP is not running, fire up DHCP.
device_->state_ = Cellular::kStateConnected;
- EXPECT_CALL(dhcp_provider_, CreateConfig(kTestDeviceName, _, _, _, _))
+ EXPECT_CALL(dhcp_provider_, CreateConfig(kTestDeviceName, _, _, _))
.WillOnce(Return(dhcp_config_));
EXPECT_CALL(*dhcp_config_, RequestIP());
EXPECT_CALL(*dhcp_config_, ReleaseIP(_)).Times(AnyNumber());
@@ -2045,7 +2045,7 @@
EXPECT_CALL(device_info_, GetFlags(device_->interface_index(), _))
.WillOnce(DoAll(SetArgumentPointee<1>(IFF_UP), Return(true)));
- EXPECT_CALL(dhcp_provider_, CreateConfig(kTestDeviceName, _, _, _, _))
+ EXPECT_CALL(dhcp_provider_, CreateConfig(kTestDeviceName, _, _, _))
.WillOnce(Return(dhcp_config_));
EXPECT_CALL(*dhcp_config_, RequestIP()).WillOnce(Return(true));
EXPECT_CALL(*service, SetState(Service::kStateConfiguring));
diff --git a/device.cc b/device.cc
index 76df528..a303528 100644
--- a/device.cc
+++ b/device.cc
@@ -436,10 +436,6 @@
return false;
}
-bool Device::ShouldUseMinimalDHCPConfig() const {
- return false;
-}
-
bool Device::IsUsingStaticIP() const {
if (!selected_service_) {
return false;
@@ -458,8 +454,7 @@
ipconfig_ = dhcp_provider_->CreateConfig(link_name_,
manager_->GetHostName(),
lease_name,
- arp_gateway,
- ShouldUseMinimalDHCPConfig());
+ arp_gateway);
ipconfig_->RegisterUpdateCallback(Bind(&Device::OnIPConfigUpdated,
weak_ptr_factory_.GetWeakPtr()));
ipconfig_->RegisterFailureCallback(Bind(&Device::OnIPConfigFailed,
diff --git a/device.h b/device.h
index 7a4dc08..e8743a7 100644
--- a/device.h
+++ b/device.h
@@ -290,7 +290,6 @@
FRIEND_TEST(DeviceTest, SetEnabledPersistent);
FRIEND_TEST(DeviceTest, SetServiceConnectedState);
FRIEND_TEST(DeviceTest, ShouldUseArpGateway);
- FRIEND_TEST(DeviceTest, ShouldUseMinimalDHCPConfig);
FRIEND_TEST(DeviceTest, Start);
FRIEND_TEST(DeviceTest, StartTrafficMonitor);
FRIEND_TEST(DeviceTest, Stop);
@@ -461,11 +460,6 @@
// device technology.
virtual bool ShouldUseArpGateway() const;
- // Specifies whether DHCP replies have not been succeeding or we have
- // previously noticed that requesting a minimal DHCP response seems
- // to alleviate issues with receiving a reply.
- bool ShouldUseMinimalDHCPConfig() const;
-
// Indicates if the selected service is configured with a static IP address.
bool IsUsingStaticIP() const;
diff --git a/device_unittest.cc b/device_unittest.cc
index 05d006f..7056adc 100644
--- a/device_unittest.cc
+++ b/device_unittest.cc
@@ -297,7 +297,7 @@
scoped_refptr<MockDHCPConfig> dhcp_config(new MockDHCPConfig(
control_interface(),
kDeviceName));
- EXPECT_CALL(*dhcp_provider, CreateConfig(_, _, _, _, _))
+ EXPECT_CALL(*dhcp_provider, CreateConfig(_, _, _, _))
.WillOnce(Return(dhcp_config));
EXPECT_CALL(*dhcp_config, RequestIP())
.WillOnce(Return(false));
@@ -787,10 +787,6 @@
EXPECT_FALSE(device_->ShouldUseArpGateway());
}
-TEST_F(DeviceTest, ShouldUseMinimalDHCPConfig) {
- EXPECT_FALSE(device_->ShouldUseMinimalDHCPConfig());
-}
-
TEST_F(DeviceTest, PerformTDLSOperation) {
EXPECT_EQ("",
device_->PerformTDLSOperation("do something", "to someone", NULL));
diff --git a/dhcp_config.cc b/dhcp_config.cc
index fbca08c..a6e1fe2 100644
--- a/dhcp_config.cc
+++ b/dhcp_config.cc
@@ -48,7 +48,6 @@
"WebProxyAutoDiscoveryUrl";
const int DHCPConfig::kDHCPCDExitPollMilliseconds = 50;
const int DHCPConfig::kDHCPCDExitWaitMilliseconds = 3000;
-const char DHCPConfig::kDHCPCDMinimalConfig[] = "/etc/dhcpcd-minimal.conf";
const char DHCPConfig::kDHCPCDPath[] = "/sbin/dhcpcd";
const char DHCPConfig::kDHCPCDPathFormatPID[] =
"var/run/dhcpcd/dhcpcd-%s.pid";
@@ -72,7 +71,6 @@
const string &request_hostname,
const string &lease_file_suffix,
bool arp_gateway,
- bool is_minimal_config,
GLib *glib)
: IPConfig(control_interface, device_name, kType),
proxy_factory_(ProxyFactory::GetInstance()),
@@ -80,7 +78,6 @@
request_hostname_(request_hostname),
lease_file_suffix_(lease_file_suffix),
arp_gateway_(arp_gateway),
- is_minimal_config_(is_minimal_config),
pid_(0),
child_watch_tag_(0),
is_lease_active_(false),
@@ -240,10 +237,6 @@
args.push_back(const_cast<char *>("-R")); // ARP for default gateway.
args.push_back(const_cast<char *>("-U")); // Enable unicast ARP on renew.
}
- if (is_minimal_config_) {
- args.push_back(const_cast<char *>("-f")); // Supply a configuration file.
- args.push_back(const_cast<char *>(kDHCPCDMinimalConfig));
- }
string interface_arg(device_name());
if (lease_file_suffix_ != device_name()) {
interface_arg = base::StringPrintf("%s=%s", device_name().c_str(),
diff --git a/dhcp_config.h b/dhcp_config.h
index 97d7deb..d4a7ae1 100644
--- a/dhcp_config.h
+++ b/dhcp_config.h
@@ -51,7 +51,6 @@
const std::string &request_hostname,
const std::string &lease_file_suffix,
bool arp_gateway,
- bool is_minimal_config,
GLib *glib);
virtual ~DHCPConfig();
@@ -98,7 +97,6 @@
FRIEND_TEST(DHCPConfigTest, RestartNoClient);
FRIEND_TEST(DHCPConfigTest, StartFail);
FRIEND_TEST(DHCPConfigTest, StartWithHostname);
- FRIEND_TEST(DHCPConfigTest, StartWithMinimalConfig);
FRIEND_TEST(DHCPConfigTest, StartWithoutArpGateway);
FRIEND_TEST(DHCPConfigTest, StartWithoutHostname);
FRIEND_TEST(DHCPConfigTest, StartWithoutLeaseSuffix);
@@ -126,7 +124,6 @@
static const char kDHCPCDPath[];
static const char kDHCPCDPathFormatPID[];
static const char kDHCPCDUser[];
- static const char kDHCPCDMinimalConfig[];
static const char kReasonBound[];
static const char kReasonFail[];
@@ -212,11 +209,6 @@
// the acquired IP address using an ARP request to the gateway IP address.
bool arp_gateway_;
- // Specifies whether to configure the the DHCP client to request the bare
- // minimum of options in order to escape any MTU issues with the packet size
- // of the DHCP server's reply.
- bool is_minimal_config_;
-
// The PID of the spawned DHCP client. May be 0 if no client has been spawned
// yet or the client has died.
int pid_;
diff --git a/dhcp_config_unittest.cc b/dhcp_config_unittest.cc
index 5dbaa70..3b4d353 100644
--- a/dhcp_config_unittest.cc
+++ b/dhcp_config_unittest.cc
@@ -49,7 +49,6 @@
const bool kArpGateway = true;
const bool kHasHostname = true;
const bool kHasLeaseSuffix = true;
-const bool kMinimalConfig = true;
} // namespace
class DHCPConfigTest : public PropertyStoreTest {
@@ -64,7 +63,6 @@
kHostName,
kLeaseFileSuffix,
kArpGateway,
- !kMinimalConfig,
glib())) {}
virtual void SetUp() {
@@ -83,12 +81,10 @@
DHCPConfigRefPtr CreateMockMinijailConfig(const string &hostname,
const string &lease_suffix,
- bool arp_gateway,
- bool minimal_config);
+ bool arp_gateway);
DHCPConfigRefPtr CreateRunningConfig(const string &hostname,
const string &lease_suffix,
- bool arp_gateway,
- bool minimal_config);
+ bool arp_gateway);
void StopRunningConfigAndExpect(DHCPConfigRefPtr config,
bool lease_file_exists);
@@ -112,8 +108,7 @@
DHCPConfigRefPtr DHCPConfigTest::CreateMockMinijailConfig(
const string &hostname,
const string &lease_suffix,
- bool arp_gateway,
- bool minimal_config) {
+ bool arp_gateway) {
DHCPConfigRefPtr config(new DHCPConfig(&control_,
dispatcher(),
DHCPProvider::GetInstance(),
@@ -121,18 +116,15 @@
hostname,
lease_suffix,
arp_gateway,
- minimal_config,
glib()));
config->minijail_ = minijail_.get();
return config;
}
-DHCPConfigRefPtr DHCPConfigTest::CreateRunningConfig(
- const string &hostname,
- const string &lease_suffix,
- bool arp_gateway,
- bool minimal_config) {
+DHCPConfigRefPtr DHCPConfigTest::CreateRunningConfig(const string &hostname,
+ const string &lease_suffix,
+ bool arp_gateway) {
DHCPConfigRefPtr config(new DHCPConfig(&control_,
dispatcher(),
DHCPProvider::GetInstance(),
@@ -140,7 +132,6 @@
hostname,
lease_suffix,
arp_gateway,
- minimal_config,
glib()));
config->minijail_ = minijail_.get();
EXPECT_CALL(*minijail_, RunAndDestroy(_, _, _))
@@ -312,8 +303,7 @@
EXPECT_EQ(0, config_->pid_);
}
-MATCHER_P4(IsDHCPCDArgs, has_hostname, has_arp_gateway, has_lease_suffix,
- has_minimal_config, "") {
+MATCHER_P3(IsDHCPCDArgs, has_hostname, has_arp_gateway, has_lease_suffix, "") {
if (string(arg[0]) != "/sbin/dhcpcd" ||
string(arg[1]) != "-B" ||
string(arg[2]) != "-q") {
@@ -337,14 +327,6 @@
end_offset += 2;
}
- if (has_minimal_config) {
- if (string(arg[end_offset]) != "-f" ||
- string(arg[end_offset + 1]) != "/etc/dhcpcd-minimal.conf") {
- return false;
- }
- end_offset += 2;
- }
-
string device_arg = has_lease_suffix ?
string(kDeviceName) + "=" + string(kLeaseFileSuffix) : kDeviceName;
return string(arg[end_offset]) == device_arg && arg[end_offset + 1] == NULL;
@@ -353,8 +335,7 @@
TEST_F(DHCPConfigTest, StartWithHostname) {
EXPECT_CALL(*minijail_, RunAndDestroy(_, IsDHCPCDArgs(kHasHostname,
kArpGateway,
- kHasLeaseSuffix,
- !kMinimalConfig), _))
+ kHasLeaseSuffix), _))
.WillOnce(Return(false));
EXPECT_FALSE(config_->Start());
}
@@ -362,12 +343,10 @@
TEST_F(DHCPConfigTest, StartWithoutHostname) {
DHCPConfigRefPtr config = CreateMockMinijailConfig("",
kLeaseFileSuffix,
- kArpGateway,
- !kMinimalConfig);
+ kArpGateway);
EXPECT_CALL(*minijail_, RunAndDestroy(_, IsDHCPCDArgs(!kHasHostname,
kArpGateway,
- kHasLeaseSuffix,
- !kMinimalConfig), _))
+ kHasLeaseSuffix), _))
.WillOnce(Return(false));
EXPECT_FALSE(config->Start());
}
@@ -375,12 +354,10 @@
TEST_F(DHCPConfigTest, StartWithoutArpGateway) {
DHCPConfigRefPtr config = CreateMockMinijailConfig(kHostName,
kLeaseFileSuffix,
- !kArpGateway,
- !kMinimalConfig);
+ !kArpGateway);
EXPECT_CALL(*minijail_, RunAndDestroy(_, IsDHCPCDArgs(kHasHostname,
!kArpGateway,
- kHasLeaseSuffix,
- !kMinimalConfig), _))
+ kHasLeaseSuffix), _))
.WillOnce(Return(false));
EXPECT_FALSE(config->Start());
}
@@ -388,25 +365,10 @@
TEST_F(DHCPConfigTest, StartWithoutLeaseSuffix) {
DHCPConfigRefPtr config = CreateMockMinijailConfig(kHostName,
kDeviceName,
- kArpGateway,
- !kMinimalConfig);
+ kArpGateway);
EXPECT_CALL(*minijail_, RunAndDestroy(_, IsDHCPCDArgs(kHasHostname,
kArpGateway,
- !kHasLeaseSuffix,
- !kMinimalConfig), _))
- .WillOnce(Return(false));
- EXPECT_FALSE(config->Start());
-}
-
-TEST_F(DHCPConfigTest, StartWithMinimalConfig) {
- DHCPConfigRefPtr config = CreateMockMinijailConfig(kHostName,
- kLeaseFileSuffix,
- kArpGateway,
- kMinimalConfig);
- EXPECT_CALL(*minijail_, RunAndDestroy(_, IsDHCPCDArgs(kHasHostname,
- kArpGateway,
- kHasLeaseSuffix,
- kMinimalConfig), _))
+ !kHasLeaseSuffix), _))
.WillOnce(Return(false));
EXPECT_FALSE(config->Start());
}
@@ -721,14 +683,13 @@
TEST_F(DHCPConfigTest, StartSuccessEphemeral) {
DHCPConfigRefPtr config =
- CreateRunningConfig(kHostName, kDeviceName, kArpGateway, !kMinimalConfig);
+ CreateRunningConfig(kHostName, kDeviceName, kArpGateway);
StopRunningConfigAndExpect(config, false);
}
TEST_F(DHCPConfigTest, StartSuccessPersistent) {
DHCPConfigRefPtr config =
- CreateRunningConfig(kHostName, kLeaseFileSuffix, kArpGateway,
- !kMinimalConfig);
+ CreateRunningConfig(kHostName, kLeaseFileSuffix, kArpGateway);
StopRunningConfigAndExpect(config, true);
}
diff --git a/dhcp_provider.cc b/dhcp_provider.cc
index ff76f1d..256bf1c 100644
--- a/dhcp_provider.cc
+++ b/dhcp_provider.cc
@@ -54,8 +54,7 @@
DHCPConfigRefPtr DHCPProvider::CreateConfig(const string &device_name,
const string &host_name,
const string &lease_file_suffix,
- bool arp_gateway,
- bool minimal_config) {
+ bool arp_gateway) {
SLOG(DHCP, 2) << __func__ << " device: " << device_name;
return new DHCPConfig(control_interface_,
dispatcher_,
@@ -64,7 +63,6 @@
host_name,
lease_file_suffix,
arp_gateway,
- minimal_config,
glib_);
}
diff --git a/dhcp_provider.h b/dhcp_provider.h
index 8de56d9..3359cb7 100644
--- a/dhcp_provider.h
+++ b/dhcp_provider.h
@@ -31,8 +31,7 @@
// DHCPProvider::GetInstance()->CreateConfig(device_name,
// host_name,
// lease_file_suffix,
-// arp_gateway,
-// minimal_config)->Request();
+// arp_gateway)->Request();
class DHCPProvider {
public:
static constexpr char kDHCPCDPathFormatLease[] =
@@ -58,14 +57,11 @@
// in |lease_file_suffix| if non-empty, otherwise |device_name|. If
// |arp_gateway| is true, the DHCP client will ARP for the gateway IP
// address as an additional safeguard against the issued IP address being
- // in-use by another station. If |minimal_config| is true, the DHCP client
- // will request the bare minimum set of options in order to gain,
- // connectivity, to maximize the potential for a successful received reply.
+ // in-use by another station.
virtual DHCPConfigRefPtr CreateConfig(const std::string &device_name,
const std::string &host_name,
const std::string &lease_file_suffix,
- bool arp_gateway,
- bool minimal_config);
+ bool arp_gateway);
// Returns the DHCP configuration associated with DHCP client |pid|. Return
// NULL if |pid| is not bound to a configuration.
diff --git a/dhcp_provider_unittest.cc b/dhcp_provider_unittest.cc
index c0e243e..32380de 100644
--- a/dhcp_provider_unittest.cc
+++ b/dhcp_provider_unittest.cc
@@ -23,7 +23,6 @@
const char kHostName[] = "testhostname";
const char kStorageIdentifier[] = "teststorageidentifier";
const bool kArpGateway = false;
-const bool kMinimalConfig = false;
} // namespace
class DHCPProviderTest : public Test {
@@ -47,8 +46,7 @@
DHCPConfigRefPtr config = provider_->CreateConfig(kDeviceName,
kHostName,
kStorageIdentifier,
- kArpGateway,
- kMinimalConfig);
+ kArpGateway);
EXPECT_TRUE(config.get());
EXPECT_EQ(&glib_, config->glib_);
EXPECT_EQ(kDeviceName, config->device_name());
diff --git a/ethernet_unittest.cc b/ethernet_unittest.cc
index 70c9a7a..2e9b136 100644
--- a/ethernet_unittest.cc
+++ b/ethernet_unittest.cc
@@ -284,7 +284,7 @@
StartEthernet();
SetService(mock_service_);
EXPECT_EQ(NULL, GetSelectedService().get());
- EXPECT_CALL(dhcp_provider_, CreateConfig(_, _, _, _, _)).
+ EXPECT_CALL(dhcp_provider_, CreateConfig(_, _, _, _)).
WillOnce(Return(dhcp_config_));
EXPECT_CALL(*dhcp_config_.get(), RequestIP()).WillOnce(Return(false));
EXPECT_CALL(dispatcher_, PostTask(_)); // Posts ConfigureStaticIPTask.
@@ -297,7 +297,7 @@
StartEthernet();
SetService(mock_service_);
EXPECT_EQ(NULL, GetSelectedService().get());
- EXPECT_CALL(dhcp_provider_, CreateConfig(_, _, _, _, _)).
+ EXPECT_CALL(dhcp_provider_, CreateConfig(_, _, _, _)).
WillOnce(Return(dhcp_config_));
EXPECT_CALL(*dhcp_config_.get(), RequestIP()).WillOnce(Return(true));
EXPECT_CALL(dispatcher_, PostTask(_)); // Posts ConfigureStaticIPTask.
diff --git a/metrics_unittest.cc b/metrics_unittest.cc
index f3e8171..8331719 100644
--- a/metrics_unittest.cc
+++ b/metrics_unittest.cc
@@ -725,35 +725,6 @@
ScopeLogger::GetInstance()->set_verbose_level(0);
}
-TEST_F(MetricsTest, NotifyDHCPOptionFailure) {
- EXPECT_CALL(*service_, technology()).
- WillOnce(Return(Technology::kWifi));
- EXPECT_CALL(library_,
- SendEnumToUMA(Metrics::kMetricDHCPOptionFailureDetected,
- Metrics::kDHCPOptionFailureTechnologyWifi,
- Metrics::kDHCPOptionFailureTechnologyMax));
- metrics_.NotifyDHCPOptionFailure(*service_);
- Mock::VerifyAndClearExpectations(service_);
-
- EXPECT_CALL(*service_, technology()).
- WillOnce(Return(Technology::kCellular));
- EXPECT_CALL(library_,
- SendEnumToUMA(Metrics::kMetricDHCPOptionFailureDetected,
- Metrics::kDHCPOptionFailureTechnologyCellular,
- Metrics::kDHCPOptionFailureTechnologyMax));
- metrics_.NotifyDHCPOptionFailure(*service_);
- Mock::VerifyAndClearExpectations(service_);
-
- EXPECT_CALL(*service_, technology()).
- WillOnce(Return(Technology::kUnknown));
- EXPECT_CALL(library_,
- SendEnumToUMA(Metrics::kMetricDHCPOptionFailureDetected,
- Metrics::kDHCPOptionFailureTechnologyUnknown,
- Metrics::kDHCPOptionFailureTechnologyMax));
- metrics_.NotifyDHCPOptionFailure(*service_);
- Mock::VerifyAndClearExpectations(service_);
-}
-
TEST_F(MetricsTest, NotifyServicesOnSameNetwork) {
EXPECT_CALL(library_,
SendToUMA(Metrics::kMetricServicesOnSameNetwork,
diff --git a/mock_dhcp_config.cc b/mock_dhcp_config.cc
index 1097dae..94648e5 100644
--- a/mock_dhcp_config.cc
+++ b/mock_dhcp_config.cc
@@ -17,7 +17,6 @@
string(),
string(),
false,
- false,
NULL) {}
MockDHCPConfig::~MockDHCPConfig() {}
diff --git a/mock_dhcp_provider.h b/mock_dhcp_provider.h
index 213cfcc..b0b8179 100644
--- a/mock_dhcp_provider.h
+++ b/mock_dhcp_provider.h
@@ -22,12 +22,11 @@
virtual ~MockDHCPProvider();
MOCK_METHOD3(Init, void(ControlInterface *, EventDispatcher *, GLib *));
- MOCK_METHOD5(CreateConfig,
+ MOCK_METHOD4(CreateConfig,
DHCPConfigRefPtr(const std::string &device_name,
const std::string &host_name,
const std::string &storage_identifier,
- bool arp_gateway,
- bool minimal_configuration));
+ bool arp_gateway));
private:
DISALLOW_COPY_AND_ASSIGN(MockDHCPProvider);
diff --git a/wifi_unittest.cc b/wifi_unittest.cc
index 46e6cb4..271c1ae 100644
--- a/wifi_unittest.cc
+++ b/wifi_unittest.cc
@@ -244,7 +244,7 @@
InstallMockScanSession();
::testing::DefaultValue< ::DBus::Path>::Set("/default/path");
- ON_CALL(dhcp_provider_, CreateConfig(_, _, _, _, _))
+ ON_CALL(dhcp_provider_, CreateConfig(_, _, _, _))
.WillByDefault(Return(dhcp_config_));
ON_CALL(*dhcp_config_.get(), RequestIP()).WillByDefault(Return(true));
@@ -562,8 +562,7 @@
EXPECT_CALL(*service, SetState(Service::kStateConfiguring));
EXPECT_CALL(*service, ResetSuspectedCredentialFailures());
- EXPECT_CALL(*dhcp_provider(), CreateConfig(_, _, _, _, _))
- .Times(AnyNumber());
+ EXPECT_CALL(*dhcp_provider(), CreateConfig(_, _, _, _)).Times(AnyNumber());
EXPECT_CALL(*dhcp_config_.get(), RequestIP()).Times(AnyNumber());
EXPECT_CALL(wifi_provider_, IncrementConnectCount(_));
ReportStateChanged(WPASupplicant::kInterfaceStateCompleted);
@@ -1222,7 +1221,7 @@
// With no selected service.
EXPECT_TRUE(wifi()->ShouldUseArpGateway());
- EXPECT_CALL(dhcp_provider_, CreateConfig(kDeviceName, _, _, true, false))
+ EXPECT_CALL(dhcp_provider_, CreateConfig(kDeviceName, _, _, true))
.WillOnce(Return(dhcp_config_));
const_cast<WiFi *>(wifi().get())->AcquireIPConfig();
@@ -1232,7 +1231,7 @@
// Selected service that does not have a static IP address.
EXPECT_CALL(*service, HasStaticIPAddress()).WillRepeatedly(Return(false));
EXPECT_TRUE(wifi()->ShouldUseArpGateway());
- EXPECT_CALL(dhcp_provider_, CreateConfig(kDeviceName, _, _, true, false))
+ EXPECT_CALL(dhcp_provider_, CreateConfig(kDeviceName, _, _, true))
.WillOnce(Return(dhcp_config_));
const_cast<WiFi *>(wifi().get())->AcquireIPConfig();
Mock::VerifyAndClearExpectations(service);
@@ -1240,7 +1239,7 @@
// Selected service that has a static IP address.
EXPECT_CALL(*service, HasStaticIPAddress()).WillRepeatedly(Return(true));
EXPECT_FALSE(wifi()->ShouldUseArpGateway());
- EXPECT_CALL(dhcp_provider_, CreateConfig(kDeviceName, _, _, false, false))
+ EXPECT_CALL(dhcp_provider_, CreateConfig(kDeviceName, _, _, false))
.WillOnce(Return(dhcp_config_));
const_cast<WiFi *>(wifi().get())->AcquireIPConfig();
}
@@ -2102,7 +2101,7 @@
TEST_F(WiFiMainTest, StateChangeBackwardsWithService) {
// Some backwards transitions should not trigger a Service state change.
// Supplicant state should still be updated, however.
- EXPECT_CALL(*dhcp_provider(), CreateConfig(_, _, _, _, _)).Times(AnyNumber());
+ EXPECT_CALL(*dhcp_provider(), CreateConfig(_, _, _, _)).Times(AnyNumber());
EXPECT_CALL(*dhcp_config_.get(), RequestIP()).Times(AnyNumber());
StartWiFi();
dispatcher_.DispatchPendingEvents();
@@ -2601,7 +2600,7 @@
// on the service just because supplicant entered the Completed state.
EXPECT_CALL(*service, SetState(Service::kStateConfiguring));
EXPECT_CALL(*service, ResetSuspectedCredentialFailures()).Times(0);
- EXPECT_CALL(*dhcp_provider(), CreateConfig(_, _, _, _, _)).Times(AnyNumber());
+ EXPECT_CALL(*dhcp_provider(), CreateConfig(_, _, _, _)).Times(AnyNumber());
EXPECT_CALL(*dhcp_config_.get(), RequestIP()).Times(AnyNumber());
EXPECT_CALL(*manager(), device_info()).WillRepeatedly(Return(device_info()));
EXPECT_CALL(*device_info(), GetByteCounts(_, _, _))
diff --git a/wimax_unittest.cc b/wimax_unittest.cc
index e447e6e..01d2161 100644
--- a/wimax_unittest.cc
+++ b/wimax_unittest.cc
@@ -202,7 +202,7 @@
}
TEST_F(WiMaxTest, UseNoArpGateway) {
- EXPECT_CALL(dhcp_provider_, CreateConfig(kTestLinkName, _, _, false, false))
+ EXPECT_CALL(dhcp_provider_, CreateConfig(kTestLinkName, _, _, false))
.WillOnce(Return(dhcp_config_));
device_->AcquireIPConfig();
}