Index: dbus/end_to_end_async_unittest.cc |
diff --git a/dbus/end_to_end_async_unittest.cc b/dbus/end_to_end_async_unittest.cc |
index 7ba782ba54870e186c17e3ac3e1f01c67bc76c6b..2cebbcf2681caa149fd88952e511c2ed36ff93fe 100644 |
--- a/dbus/end_to_end_async_unittest.cc |
+++ b/dbus/end_to_end_async_unittest.cc |
@@ -204,6 +204,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"); |