summaryrefslogtreecommitdiffstats
path: root/dbus/end_to_end_async_unittest.cc
diff options
context:
space:
mode:
authorvlaviano@chromium.org <vlaviano@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-30 04:57:42 +0000
committervlaviano@chromium.org <vlaviano@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-30 04:57:42 +0000
commit9aa74ccbcaf9f29f03ca4f0dbccd896ef4098118 (patch)
tree353aaadbdf70b223d8e0cbe71572bd9814c7e580 /dbus/end_to_end_async_unittest.cc
parentcb8a5468be6eb5072a8e9173b554448c0d06e111 (diff)
downloadchromium_src-9aa74ccbcaf9f29f03ca4f0dbccd896ef4098118.zip
chromium_src-9aa74ccbcaf9f29f03ca4f0dbccd896ef4098118.tar.gz
chromium_src-9aa74ccbcaf9f29f03ca4f0dbccd896ef4098118.tar.bz2
chrome: dbus: support asynchronous method replies
BUG=chromium-os:23241 TEST=Unit tests and manual testing on device. Change-Id: Iab009ddbd12dea1e12299ae0ddccd4e430d9cf97 Review URL: http://codereview.chromium.org/8728020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112131 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus/end_to_end_async_unittest.cc')
-rw-r--r--dbus/end_to_end_async_unittest.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/dbus/end_to_end_async_unittest.cc b/dbus/end_to_end_async_unittest.cc
index 2f486f4..5c98fe9 100644
--- a/dbus/end_to_end_async_unittest.cc
+++ b/dbus/end_to_end_async_unittest.cc
@@ -223,6 +223,24 @@ TEST_F(EndToEndAsyncTest, Timeout) {
ASSERT_EQ("", response_strings_[0]);
}
+// Tests calling a method that sends its reply asynchronously.
+TEST_F(EndToEndAsyncTest, AsyncEcho) {
+ const char* kHello = "hello";
+
+ // Create the method call.
+ dbus::MethodCall method_call("org.chromium.TestInterface", "AsyncEcho");
+ dbus::MessageWriter writer(&method_call);
+ writer.AppendString(kHello);
+
+ // Call the method.
+ const int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT;
+ CallMethod(&method_call, timeout_ms);
+
+ // Check the response.
+ WaitForResponses(1);
+ EXPECT_EQ(kHello, response_strings_[0]);
+}
+
TEST_F(EndToEndAsyncTest, NonexistentMethod) {
dbus::MethodCall method_call("org.chromium.TestInterface", "Nonexistent");