shill: Connection: Don't call Resolver::SetDNSFromIPConfig

Don't ever call this function (in fact, remove this from the
resolver), and refactor the code that correctly generates the
DNS search list so that it is usable both from
Connection::UpdateFromIPConfig() and from void
Connection::SetIsDefault().

BUG=chromium-os:34260
TEST=Rerun unit tests + Manual: Connect to AP that supplies only
"DomainName", and ensure that /etc/resolv.conf contains this domain
in the search field both initially and after DHCP renewal.

Change-Id: I9a0705cb54e6588915533cc343b05efcdee71293
Reviewed-on: https://gerrit.chromium.org/gerrit/32996
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/connection_unittest.cc b/connection_unittest.cc
index 9fc5edd..8faff31 100644
--- a/connection_unittest.cc
+++ b/connection_unittest.cc
@@ -386,8 +386,9 @@
               ConfigureRoutes(kTestDeviceInterfaceIndex0,
                               ipconfig_,
                               GetDefaultMetric()));
-  EXPECT_CALL(resolver_, SetDNSFromIPConfig(ipconfig_,
-                                            Resolver::kDefaultTimeout));
+  EXPECT_CALL(resolver_, SetDNSFromLists(ipconfig_->properties().dns_servers,
+                                         ipconfig_->properties().domain_search,
+                                         Resolver::kDefaultTimeout));
 
   connection_->UpdateFromIPConfig(ipconfig_);
 }
@@ -425,8 +426,9 @@
   EXPECT_CALL(routing_table_, FlushCache()).WillOnce(Return(true));
   connection->SetIsDefault(true);
   EXPECT_CALL(*device_info_, HasOtherAddress(_, _)).WillOnce(Return(false));
-  EXPECT_CALL(resolver_, SetDNSFromIPConfig(ipconfig_,
-                                            Resolver::kShortTimeout));
+  EXPECT_CALL(resolver_, SetDNSFromLists(ipconfig_->properties().dns_servers,
+                                         ipconfig_->properties().domain_search,
+                                         Resolver::kShortTimeout));
   connection->UpdateFromIPConfig(ipconfig_);
   AddDestructorExpectations();
 }