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..2f486f41ee182a3eee84b4388f88a44143b68543 100644 |
--- a/dbus/end_to_end_async_unittest.cc |
+++ b/dbus/end_to_end_async_unittest.cc |
@@ -55,7 +55,8 @@ class EndToEndAsyncTest : public testing::Test { |
"/org/chromium/TestObject"); |
ASSERT_TRUE(bus_->HasDBusThread()); |
- // Connect to the "Test" signal from the remote object. |
+ // Connect to the "Test" signal of "org.chromium.TestInterface" from |
+ // the remote object. |
object_proxy_->ConnectToSignal( |
"org.chromium.TestInterface", |
"Test", |
@@ -63,6 +64,18 @@ class EndToEndAsyncTest : public testing::Test { |
base::Unretained(this)), |
base::Bind(&EndToEndAsyncTest::OnConnected, |
base::Unretained(this))); |
+ // Connect to the "Test2" signal of "org.chromium.TestInterface" from |
+ // the remote object. There was a bug where we were emitting error |
+ // messages like "Requested to remove an unknown match rule: ..." at |
+ // the shutdown of Bus when an object proxy is connected to more than |
+ // one signal of the same interface. See crosbug.com/23382 for details. |
+ object_proxy_->ConnectToSignal( |
+ "org.chromium.TestInterface", |
+ "Test2", |
+ base::Bind(&EndToEndAsyncTest::OnTest2Signal, |
+ base::Unretained(this)), |
+ base::Bind(&EndToEndAsyncTest::OnConnected, |
+ base::Unretained(this))); |
// Wait until the object proxy is connected to the signal. |
message_loop_.Run(); |
} |
@@ -122,6 +135,12 @@ class EndToEndAsyncTest : public testing::Test { |
message_loop_.Quit(); |
} |
+ // Called when the "Test2" signal is received, in the main thread. |
+ void OnTest2Signal(dbus::Signal* signal) { |
+ dbus::MessageReader reader(signal); |
+ message_loop_.Quit(); |
+ } |
+ |
// Called when connected to the signal. |
void OnConnected(const std::string& interface_name, |
const std::string& signal_name, |