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

Unified Diff: dbus/end_to_end_sync_unittest.cc

Issue 10409065: Change setters of dbus::Message to return false instead of aborting on errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 8 years, 7 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/end_to_end_async_unittest.cc ('k') | dbus/exported_object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/end_to_end_sync_unittest.cc
diff --git a/dbus/end_to_end_sync_unittest.cc b/dbus/end_to_end_sync_unittest.cc
index 26a90116ac3fee5c7d5c20da44003bc8f7c2584d..9cddea48591100108c0ade483afa7cb0b87d116e 100644
--- a/dbus/end_to_end_sync_unittest.cc
+++ b/dbus/end_to_end_sync_unittest.cc
@@ -104,3 +104,35 @@ TEST_F(EndToEndSyncTest, BrokenMethod) {
object_proxy_->CallMethodAndBlock(&method_call, timeout_ms));
ASSERT_FALSE(response.get());
}
+
+TEST_F(EndToEndSyncTest, InvalidObjectPath) {
+ // Trailing '/' is only allowed for the root path.
+ const dbus::ObjectPath invalid_object_path("/org/chromium/TestObject/");
+
+ // Replace object proxy with new one.
+ object_proxy_ = client_bus_->GetObjectProxy("org.chromium.TestService",
+ invalid_object_path);
+
+ dbus::MethodCall method_call("org.chromium.TestInterface", "Echo");
+
+ const int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT;
+ scoped_ptr<dbus::Response> response(
+ object_proxy_->CallMethodAndBlock(&method_call, timeout_ms));
+ ASSERT_FALSE(response.get());
+}
+
+TEST_F(EndToEndSyncTest, InvalidServiceName) {
+ // Bus name cannot contain '/'.
+ const std::string invalid_service_name = ":1/2";
+
+ // Replace object proxy with new one.
+ object_proxy_ = client_bus_->GetObjectProxy(
+ invalid_service_name, dbus::ObjectPath("org.chromium.TestObject"));
+
+ dbus::MethodCall method_call("org.chromium.TestInterface", "Echo");
+
+ const int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT;
+ scoped_ptr<dbus::Response> response(
+ object_proxy_->CallMethodAndBlock(&method_call, timeout_ms));
+ ASSERT_FALSE(response.get());
+}
« no previous file with comments | « dbus/end_to_end_async_unittest.cc ('k') | dbus/exported_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698