shill: Change how mock ipconfig expectations are set on a device

EXPECT_CALL() doesn't seem to to do the right thing on gtest/gmock-1.6
resulting in a unit test. Instead, use Device::set_ipconfig() to set
the mock IPConfig object to use on a MockDevice.

BUG=chromium:211445
TEST=built and ran shill unit tests

Change-Id: I63ec481235eccfa2a3a1594dc6ff94acca07d23c
Reviewed-on: https://gerrit.chromium.org/gerrit/47701
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
diff --git a/traffic_monitor_unittest.cc b/traffic_monitor_unittest.cc
index 695790b..cd078ef 100644
--- a/traffic_monitor_unittest.cc
+++ b/traffic_monitor_unittest.cc
@@ -67,11 +67,10 @@
     monitor_.socket_info_reader_.reset(
         mock_socket_info_reader_);  // Passes ownership
 
+    device_->set_ipconfig(ipconfig_);
     ipconfig_properties_.address = kLocalIpAddr;
     EXPECT_CALL(*ipconfig_.get(), properties())
         .WillRepeatedly(ReturnRef(ipconfig_properties_));
-    EXPECT_CALL(*device_.get(), ipconfig())
-        .WillRepeatedly(ReturnRef(ipconfig_));
   }
 
   void VerifyStopped() {