shill: Perform Portal Detection in Device

When a connection completes, start a portal detection request, which
may change the state of the selected service. Bonus changes: removed
Service::kStateReady, since Service::kStateConnected maps directly
to flimflam::kStateReady.  Also, move technology list parsing over
to technology.cc.

BUG=chromium-os:23318
TEST=New unit tests

Change-Id: I2fad724165af6914c8f83bc123f07db5af223a05
Reviewed-on: https://gerrit.chromium.org/gerrit/16117
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/metrics.cc b/metrics.cc
index 7eb631b..a5cf731 100644
--- a/metrics.cc
+++ b/metrics.cc
@@ -244,7 +244,7 @@
   if (new_state == Service::kStateFailure)
     SendServiceFailure(service);
 
-  if (new_state != Service::kStateReady)
+  if (new_state != Service::kStateConnected)
     return;
 
   service->SendPostReadyStateMetrics();
@@ -289,18 +289,18 @@
       service,
       histogram,
       Service::kStateConfiguring,
-      Service::kStateReady);
+      Service::kStateConnected);
   histogram = GetFullMetricName(kMetricTimeToPortalMilliseconds, technology);
   AddServiceStateTransitionTimer(
       service,
       histogram,
-      Service::kStateReady,
+      Service::kStateConnected,
       Service::kStatePortal);
   histogram = GetFullMetricName(kMetricTimeToOnlineMilliseconds, technology);
   AddServiceStateTransitionTimer(
       service,
       histogram,
-      Service::kStateReady,
+      Service::kStateConnected,
       Service::kStateOnline);
 }