[shill] Start cleaning up some of the naming confusion
We have, so far, not been tidy wrt our objects naming themselves,
for human-readable stuff, RPC-path stuff, etc.
This starts to clean up some of that confusion.
BUG=chromium-os:17744
TEST=unit tests
Change-Id: If4d7f61ba51e527984328a0ccdf4dec461b36074
Reviewed-on: http://gerrit.chromium.org/gerrit/4311
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/profile_unittest.cc b/profile_unittest.cc
index 115afe8..87e721c 100644
--- a/profile_unittest.cc
+++ b/profile_unittest.cc
@@ -25,7 +25,7 @@
class ProfileTest : public PropertyStoreTest {
public:
ProfileTest()
- : profile_(new Profile(&control_interface_, &glib_, &manager_)) {
+ : profile_(new MockProfile(&control_interface_, &glib_, &manager_, "")) {
}
protected:
@@ -74,16 +74,17 @@
EXPECT_EQ(kIdentifier2, identifier.identifier);
}
-TEST_F(ProfileTest, GetRpcPath) {
+TEST_F(ProfileTest, GetFriendlyName) {
static const char kUser[] = "theUser";
static const char kIdentifier[] = "theIdentifier";
- static const char kPathPrefix[] = "/profile/";
- Profile::Identifier identifier;
- identifier.identifier = kIdentifier;
- EXPECT_EQ(string(kPathPrefix) + kIdentifier, Profile::GetRpcPath(identifier));
- identifier.user = kUser;
- EXPECT_EQ(string(kPathPrefix) + kUser + "/" + kIdentifier,
- Profile::GetRpcPath(identifier));
+ Profile::Identifier id;
+ id.identifier = kIdentifier;
+ ProfileRefPtr profile(
+ new Profile(&control_interface_, &glib_, &manager_, id, false));
+ EXPECT_EQ(kIdentifier, profile->GetFriendlyName());
+ id.user = kUser;
+ profile = new Profile(&control_interface_, &glib_, &manager_, id, false);
+ EXPECT_EQ(string(kUser) + "/" + kIdentifier, profile->GetFriendlyName());
}
TEST_F(ProfileTest, GetStoragePath) {