shill: Implement GetEntry on Profile
Implement "GetEntry" on profile_dbus_adaptor. This change adds
the ability to look up a Service in the Manager by its
StorageIdentifier and then to return its properties to the caller.
If the Service does not exist in the manager, we have to read
directly out of the Profile's store and build a DBus property dict
out of its contents. This is a pretty gross method, and I've already
created a bug to remove this as soon as we can diverge from the
flimflam Profile API. crosbug.com/25813
BUG=chromium-os:25542
TEST=New unit tests + Manual: chrome://settings/internet now lists
both visible and unavailable networks under "Remembered Networks"
and clikcing on "Forget Network" purges the network from the profile.
Change-Id: Ib2f0ab772e40a1f615206a7b985be446fc7facde
Reviewed-on: https://gerrit.chromium.org/gerrit/15200
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/profile_unittest.cc b/profile_unittest.cc
index 3514a97..8947275 100644
--- a/profile_unittest.cc
+++ b/profile_unittest.cc
@@ -96,27 +96,35 @@
}
Mock::VerifyAndClearExpectations(storage);
- EXPECT_CALL(*storage, ContainsGroup(kEntryName))
- .WillRepeatedly(Return(true));
// If HandleProfileEntryDeletion() returns false, Profile should call
// DeleteGroup() itself.
+ EXPECT_CALL(*storage, ContainsGroup(kEntryName))
+ .WillOnce(Return(true));
EXPECT_CALL(*manager.get(), HandleProfileEntryDeletion(_, kEntryName))
.WillOnce(Return(false));
EXPECT_CALL(*storage, DeleteGroup(kEntryName))
.WillOnce(Return(true));
+ EXPECT_CALL(*storage, Flush())
+ .WillOnce(Return(true));
{
Error error;
profile_->DeleteEntry(kEntryName, &error);
EXPECT_TRUE(error.IsSuccess());
}
+ Mock::VerifyAndClearExpectations(storage);
+
// If HandleProfileEntryDeletion() returns true, Profile should not call
// DeleteGroup() itself.
+ EXPECT_CALL(*storage, ContainsGroup(kEntryName))
+ .WillOnce(Return(true));
EXPECT_CALL(*manager.get(), HandleProfileEntryDeletion(_, kEntryName))
.WillOnce(Return(true));
EXPECT_CALL(*storage, DeleteGroup(kEntryName))
.Times(0);
+ EXPECT_CALL(*storage, Flush())
+ .WillOnce(Return(true));
{
Error error;
profile_->DeleteEntry(kEntryName, &error);