0

dbus: Add IsInterfaceRegistered to ObjectManager

This change adds a new public method to check whether a specific
interface is currently registered with ObjectManager. It will be used
mainly for testing.

BUG=b:193712484
TEST=autoninja -c out/Default chrome

Change-Id: I46b0ad58afd7334693393b1c9a0291bb94a58dd0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3089691
Commit-Queue: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Reviewed-by: Ryo Hashimoto <hashimoto@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#912402}
This commit is contained in:
Abhishek Pandit-Subedi
2021-08-17 00:37:01 +00:00
committed by Chromium LUCI CQ
parent e95256fed9
commit 94ccec0eac
2 changed files with 8 additions and 0 deletions

@ -93,6 +93,11 @@ void ObjectManager::UnregisterInterface(const std::string& interface_name) {
interface_map_.erase(iter);
}
bool ObjectManager::IsInterfaceRegisteredForTesting(
const std::string& interface_name) const {
return interface_map_.count(interface_name);
}
std::vector<ObjectPath> ObjectManager::GetObjects() {
std::vector<ObjectPath> object_paths;

@ -200,6 +200,9 @@ class CHROME_DBUS_EXPORT ObjectManager final
// ignored.
void UnregisterInterface(const std::string& interface_name);
// Checks whether an interface is registered.
bool IsInterfaceRegisteredForTesting(const std::string& interface_name) const;
// Returns a list of object paths, in an undefined order, of objects known
// to this manager.
std::vector<ObjectPath> GetObjects();