libchromeos: Make sure DBusInterface::HandleMethodCall is under test
There was a regression in DBusInterface::HandleMethodCall which broke
all the actual D-Bus object implementations but this wasn't caught
by the unit test because chromeos::dbus_utils::testing::CallMethod()
bypasses DBusInterface::HandleMethodCall and looks up the method handler
directly, then invokes it.
So, this change contains:
- Removed DBusObject::FindMethodHandler(). This method was used only
in tests but it bypasses DBusInterface::HandleMethodCall() when
invoking method handlers.
- Added DBusObject::FindInterface() helper methods, so
testing::CallMethod() can find the corresponding interface and
call its DBusInterface::HandleMethodCall() method
- Changed testing::CallMethod() to invoke the method handler on
the interface to make sure that code is under test too.
- Since DBusInterface::HandleMethodCall() is private, I added
a friend helper class DBusInterfaceTestHelper to allow the test
code to still call that method without making it public.
BUG=None
TEST=FEATURES=test emerge-link libchromeos buffet peerd lorgnette
Change-Id: I05d342d58ad16070cdbef41b8281f8d3b8a5a223
Reviewed-on: https://chromium-review.googlesource.com/228442
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
3 files changed