summaryrefslogtreecommitdiffstats
path: root/dbus
diff options
context:
space:
mode:
authorsatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-13 17:08:42 +0000
committersatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-13 17:08:42 +0000
commit4c985c6f4ee822deaa2df491fd180ca88640aacd (patch)
tree9414a71818c9455f441dbfb95f2b4584e2ba0437 /dbus
parent83d93aeffe77e58f0d87f67f8e25f3e74f76d868 (diff)
downloadchromium_src-4c985c6f4ee822deaa2df491fd180ca88640aacd.zip
chromium_src-4c985c6f4ee822deaa2df491fd180ca88640aacd.tar.gz
chromium_src-4c985c6f4ee822deaa2df491fd180ca88640aacd.tar.bz2
Fix flaky tests in EndToEndAsyncTest in dbus_unittests.
We should wait for signal connection, for each signal. Otherwise, 2nd call to OnConnected() may quit the message loop instead of OnTestSignal(). FWIW, the flakiness was introduced in crrev.com/111423 BUG=106796,107301 TEST=confirm the test no longer fails by: while true; do out/Release/dbus_unittests --gtest_filter=EndToEndAsyncTest.TestSignal || break ; done Review URL: http://codereview.chromium.org/8907010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114223 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus')
-rw-r--r--dbus/end_to_end_async_unittest.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/dbus/end_to_end_async_unittest.cc b/dbus/end_to_end_async_unittest.cc
index 707c4d8..150ed29 100644
--- a/dbus/end_to_end_async_unittest.cc
+++ b/dbus/end_to_end_async_unittest.cc
@@ -64,6 +64,9 @@ class EndToEndAsyncTest : public testing::Test {
base::Unretained(this)),
base::Bind(&EndToEndAsyncTest::OnConnected,
base::Unretained(this)));
+ // Wait until the object proxy is connected to the signal.
+ message_loop_.Run();
+
// 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
@@ -285,8 +288,7 @@ TEST_F(EndToEndAsyncTest, EmptyResponseCallback) {
// check if the test does not crash.
}
-// Flaky, http://crbug.com/107301
-TEST_F(EndToEndAsyncTest, FLAKY_TestSignal) {
+TEST_F(EndToEndAsyncTest, TestSignal) {
const char kMessage[] = "hello, world";
// Send the test signal from the exported object.
test_service_->SendTestSignal(kMessage);
@@ -296,8 +298,7 @@ TEST_F(EndToEndAsyncTest, FLAKY_TestSignal) {
ASSERT_EQ(kMessage, test_signal_string_);
}
-// Flaky, http://crbug.com/106796
-TEST_F(EndToEndAsyncTest, FLAKY_TestSignalFromRoot) {
+TEST_F(EndToEndAsyncTest, TestSignalFromRoot) {
const char kMessage[] = "hello, world";
// Send the test signal from the root object path, to see if we can
// handle signals sent from "/", like dbus-send does.