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

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: Use pair, factor out error logging logic 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
« no previous file with comments | « dbus/bus.cc ('k') | dbus/mock_bus.h » ('j') | dbus/object_proxy.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/bus_unittest.cc
diff --git a/dbus/bus_unittest.cc b/dbus/bus_unittest.cc
index bbd2a4cf1c177aad93411fab5cef8bb2dac6f91b..ad924a92e07a743cc7ff8b7b77438523ec13de1c 100644
--- a/dbus/bus_unittest.cc
+++ b/dbus/bus_unittest.cc
@@ -50,6 +50,38 @@ 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->GetObjectProxyWithOptions(
+ "org.chromium.TestService",
+ "/org/chromium/TestObject",
+ dbus::ObjectProxy::IGNORE_SERVICE_UNKNOWN_ERRORS);
+ ASSERT_TRUE(object_proxy1);
+
+ // This should return the same object.
+ dbus::ObjectProxy* object_proxy2 =
+ bus->GetObjectProxyWithOptions(
+ "org.chromium.TestService",
+ "/org/chromium/TestObject",
+ dbus::ObjectProxy::IGNORE_SERVICE_UNKNOWN_ERRORS);
+ ASSERT_TRUE(object_proxy2);
+ EXPECT_EQ(object_proxy1, object_proxy2);
+
+ // This should not.
+ dbus::ObjectProxy* object_proxy3 =
+ bus->GetObjectProxyWithOptions(
+ "org.chromium.TestService",
+ "/org/chromium/DifferentTestObject",
+ dbus::ObjectProxy::IGNORE_SERVICE_UNKNOWN_ERRORS);
+ 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);
« no previous file with comments | « dbus/bus.cc ('k') | dbus/mock_bus.h » ('j') | dbus/object_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698