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

Unified Diff: dbus/end_to_end_async_unittest.cc

Issue 8681002: dbus: Fix a bug where we were emitting spurious error messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 9 years, 1 month 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 | « no previous file | dbus/object_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « no previous file | dbus/object_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698