Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2280)

Unified Diff: dbus/bus_unittest.cc

Issue 9373039: Allow dbus clients to silence logging when a service is unavailable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dbus/bus_unittest.cc
diff --git a/dbus/bus_unittest.cc b/dbus/bus_unittest.cc
index bbd2a4cf1c177aad93411fab5cef8bb2dac6f91b..8fa46de9243d22f88bc5a7607e3b0c01d882e647 100644
--- a/dbus/bus_unittest.cc
+++ b/dbus/bus_unittest.cc
@@ -50,6 +50,32 @@ TEST(BusTest, GetObjectProxy) {
bus->ShutdownAndBlock();
}
+TEST(BusTest, GetObjectProxyIgnoreUnknownService) {
+ dbus::Bus::Options options;
+ scoped_refptr<dbus::Bus> bus = new dbus::Bus(options);
+
+ dbus::ObjectProxy* object_proxy1 =
+ bus->GetObjectProxyIgnoreUnknownService(
+ "org.chromium.TestService", "/org/chromium/TestObject");
+ ASSERT_TRUE(object_proxy1);
+
+ // This should return the same object.
+ dbus::ObjectProxy* object_proxy2 =
+ bus->GetObjectProxyIgnoreUnknownService(
+ "org.chromium.TestService", "/org/chromium/TestObject");
+ ASSERT_TRUE(object_proxy2);
+ EXPECT_EQ(object_proxy1, object_proxy2);
+
+ // This should not.
+ dbus::ObjectProxy* object_proxy3 =
+ bus->GetObjectProxyIgnoreUnknownService(
+ "org.chromium.TestService", "/org/chromium/DifferentTestObject");
+ ASSERT_TRUE(object_proxy3);
+ EXPECT_NE(object_proxy1, object_proxy3);
+
+ bus->ShutdownAndBlock();
+}
+
TEST(BusTest, GetExportedObject) {
dbus::Bus::Options options;
scoped_refptr<dbus::Bus> bus = new dbus::Bus(options);

Powered by Google App Engine
This is Rietveld 408576698