shill: Add CellularCapabilityUniversal

Add the CellularCapabilityUniversal class so that shill can talk to a
ModemManager1 DBUS interface.  Ensure that a modems can be created
with either the new or the old modem manager running.

Register to receive DBus property changes from ModemManager1

BUG=chromium-os:28596, chromium-os:26650
TEST=Run unit tests, test that modem is created with Y3300

Change-Id: I8717318e944589bc85e763bd7234336559256dbc
Reviewed-on: https://gerrit.chromium.org/gerrit/19888
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
diff --git a/modem.h b/modem.h
index 0eb684c..92789ff 100644
--- a/modem.h
+++ b/modem.h
@@ -9,6 +9,7 @@
 #include <vector>
 
 #include <base/basictypes.h>
+#include <base/file_util.h>
 #include <base/memory/scoped_ptr.h>
 #include <gtest/gtest_prod.h>  // for FRIEND_TEST
 
@@ -82,7 +83,11 @@
 
  private:
   friend class ModemTest;
+  friend class Modem1Test;
+  FRIEND_TEST(Modem1Test, Init);
+  FRIEND_TEST(Modem1Test, CreateDeviceMM1);
   FRIEND_TEST(ModemManager1Test, Connect);
+  FRIEND_TEST(ModemManager1Test, AddRemoveInterfaces);
   FRIEND_TEST(ModemManagerClassicTest, Connect);
   FRIEND_TEST(ModemManagerCoreTest, ShouldAddModem);
   FRIEND_TEST(ModemTest, CreateDeviceEarlyFailures);
@@ -120,6 +125,9 @@
   bool pending_device_info_;
   RTNLHandler *rtnl_handler_;
 
+  // Store cached copies of singletons for speed/ease of testing.
+  ProxyFactory *proxy_factory_;
+
   DISALLOW_COPY_AND_ASSIGN(Modem);
 };
 
@@ -148,8 +156,6 @@
 };
 
 class Modem1 : public Modem {
-  // TODO(rochberg) Need to register to receive DBus property changes.
-  // crosbug.com/28596
  public:
   Modem1(const std::string &owner,
          const std::string &path,
@@ -170,6 +176,10 @@
                            std::string *name) const;
 
  private:
+  friend class Modem1Test;
+
+  FilePath netfiles_path_;  // Used for testing
+
   DISALLOW_COPY_AND_ASSIGN(Modem1);
 };