diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-02 21:48:37 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-02 21:48:37 +0000 |
commit | f285d9c29dd7428e89c34f0724fbd63d4526dc50 (patch) | |
tree | 483ecb90f73fea0966090b95502a95f7b14af0c2 /remoting/protocol | |
parent | f9c0ecaa9af8a0b7708e563c5da495943eb000f3 (diff) | |
download | chromium_src-f285d9c29dd7428e89c34f0724fbd63d4526dc50.zip chromium_src-f285d9c29dd7428e89c34f0724fbd63d4526dc50.tar.gz chromium_src-f285d9c29dd7428e89c34f0724fbd63d4526dc50.tar.bz2 |
Fix flakiness in JingleChromotingConnectionTest
TEST=remoting_unittests
BUG=None
TBR=hclam
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61314 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol')
-rw-r--r-- | remoting/protocol/jingle_chromoting_connection.cc | 2 | ||||
-rw-r--r-- | remoting/protocol/jingle_chromoting_connection_unittest.cc | 14 |
2 files changed, 12 insertions, 4 deletions
diff --git a/remoting/protocol/jingle_chromoting_connection.cc b/remoting/protocol/jingle_chromoting_connection.cc index 758057c..5c2e246 100644 --- a/remoting/protocol/jingle_chromoting_connection.cc +++ b/remoting/protocol/jingle_chromoting_connection.cc @@ -127,6 +127,8 @@ void JingleChromotingConnection::Close(Task* closed_task) { if (session_) session_->Terminate(); + SetState(CLOSED); + closed_ = true; } diff --git a/remoting/protocol/jingle_chromoting_connection_unittest.cc b/remoting/protocol/jingle_chromoting_connection_unittest.cc index bb96eec..a517592 100644 --- a/remoting/protocol/jingle_chromoting_connection_unittest.cc +++ b/remoting/protocol/jingle_chromoting_connection_unittest.cc @@ -96,7 +96,7 @@ class JingleChromotingConnectionTest : public testing::Test { void CloseConnections() { if (host_connection_) { host_connection_->Close(NewRunnableFunction( - &JingleChromotingConnectionTest::DoNothing)); + &JingleChromotingConnectionTest::DoNothing)); } if (client_connection_) { client_connection_->Close(NewRunnableFunction( @@ -139,6 +139,10 @@ class JingleChromotingConnectionTest : public testing::Test { .Times(1) .WillOnce(InvokeWithoutArgs(&host_connected_event, &base::WaitableEvent::Signal)); + // Expect that the connection will be closed eventually. + EXPECT_CALL(host_connection_callback_, + OnStateChange(ChromotingConnection::CLOSED)) + .Times(1); base::WaitableEvent client_connected_event(false, false); EXPECT_CALL(client_connection_callback_, @@ -149,6 +153,10 @@ class JingleChromotingConnectionTest : public testing::Test { .Times(1) .WillOnce(InvokeWithoutArgs(&client_connected_event, &base::WaitableEvent::Signal)); + // Expect that the connection will be closed eventually. + EXPECT_CALL(client_connection_callback_, + OnStateChange(ChromotingConnection::CLOSED)) + .Times(1); client_connection_ = client_server_->Connect( SessionManagerPair::kHostJid, @@ -562,9 +570,7 @@ TEST_F(JingleChromotingConnectionTest, TestEventsChannel) { } // Verify that data can be transmitted over the video RTP channel. -// TODO(sergeyu): This test is disabled at the moment because of -// flakiness. -TEST_F(JingleChromotingConnectionTest, DISABLED_TestVideoRtpChannel) { +TEST_F(JingleChromotingConnectionTest, TestVideoRtpChannel) { CreateServerPair(); InitiateConnection(); scoped_refptr<UDPChannelTester> tester = |