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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dbus/end_to_end_async_unittest.cc ('k') | dbus/exported_object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "dbus/bus.h" 7 #include "dbus/bus.h"
8 #include "dbus/message.h" 8 #include "dbus/message.h"
9 #include "dbus/object_path.h" 9 #include "dbus/object_path.h"
10 #include "dbus/object_proxy.h" 10 #include "dbus/object_proxy.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 98
99 TEST_F(EndToEndSyncTest, BrokenMethod) { 99 TEST_F(EndToEndSyncTest, BrokenMethod) {
100 dbus::MethodCall method_call("org.chromium.TestInterface", "BrokenMethod"); 100 dbus::MethodCall method_call("org.chromium.TestInterface", "BrokenMethod");
101 101
102 const int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT; 102 const int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT;
103 scoped_ptr<dbus::Response> response( 103 scoped_ptr<dbus::Response> response(
104 object_proxy_->CallMethodAndBlock(&method_call, timeout_ms)); 104 object_proxy_->CallMethodAndBlock(&method_call, timeout_ms));
105 ASSERT_FALSE(response.get()); 105 ASSERT_FALSE(response.get());
106 } 106 }
107
108 TEST_F(EndToEndSyncTest, InvalidObjectPath) {
109 // Trailing '/' is only allowed for the root path.
110 const dbus::ObjectPath invalid_object_path("/org/chromium/TestObject/");
111
112 // Replace object proxy with new one.
113 object_proxy_ = client_bus_->GetObjectProxy("org.chromium.TestService",
114 invalid_object_path);
115
116 dbus::MethodCall method_call("org.chromium.TestInterface", "Echo");
117
118 const int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT;
119 scoped_ptr<dbus::Response> response(
120 object_proxy_->CallMethodAndBlock(&method_call, timeout_ms));
121 ASSERT_FALSE(response.get());
122 }
123
124 TEST_F(EndToEndSyncTest, InvalidServiceName) {
125 // Bus name cannot contain '/'.
126 const std::string invalid_service_name = ":1/2";
127
128 // Replace object proxy with new one.
129 object_proxy_ = client_bus_->GetObjectProxy(
130 invalid_service_name, dbus::ObjectPath("org.chromium.TestObject"));
131
132 dbus::MethodCall method_call("org.chromium.TestInterface", "Echo");
133
134 const int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT;
135 scoped_ptr<dbus::Response> response(
136 object_proxy_->CallMethodAndBlock(&method_call, timeout_ms));
137 ASSERT_FALSE(response.get());
138 }
OLDNEW
« 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