[shill] Make profiles backed with StoreInterfaces

Rely on persistence of data in StoreInterface to maintain
Service/Device/IPConfig info for entities that are not
currently active, instead of maintaining lists in Profile
objects themselves.

BUG=chromium-os:17253
TEST=unit, run on device

Change-Id: I206f44ddf16c584354f8fcadb57032f047f33d0a
Reviewed-on: http://gerrit.chromium.org/gerrit/10024
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/mock_service.cc b/mock_service.cc
index fafb8cd..5b44fda 100644
--- a/mock_service.cc
+++ b/mock_service.cc
@@ -11,6 +11,7 @@
 #include <gmock/gmock.h>
 
 #include "shill/refptr_types.h"
+#include "shill/store_interface.h"
 
 using std::string;
 using testing::_;
@@ -26,7 +27,9 @@
                          EventDispatcher *dispatcher,
                          Manager *manager)
     : Service(control_interface, dispatcher, manager, "mock") {
-  ON_CALL(*this, GetRpcIdentifier()).WillByDefault(Return(""));
+  const string &id = UniqueName();
+  EXPECT_CALL(*this, GetRpcIdentifier()).WillRepeatedly(Return(id));
+  EXPECT_CALL(*this, GetStorageIdentifier()).WillRepeatedly(Return(id));
   ON_CALL(*this, state()).WillByDefault(Return(kStateUnknown));
   ON_CALL(*this, failure()).WillByDefault(Return(kFailureUnknown));
   ON_CALL(*this, TechnologyIs(_)).WillByDefault(Return(false));
@@ -34,4 +37,8 @@
 
 MockService::~MockService() {}
 
+bool MockService::FauxSave(StoreInterface *store) {
+  return store->SetString(UniqueName(), "dummy", "dummy");
+}
+
 }  // namespace shill