diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 22:34:00 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 22:34:00 +0000 |
commit | fb578635ffff99206af1cf78f9c698a524a61479 (patch) | |
tree | 1d5735a69073bdeaae2a49d43ac6e51067e94ed2 /remoting | |
parent | 115dcfe4de38512d865f5de3dfff89e0f6adc726 (diff) | |
download | chromium_src-fb578635ffff99206af1cf78f9c698a524a61479.zip chromium_src-fb578635ffff99206af1cf78f9c698a524a61479.tar.gz chromium_src-fb578635ffff99206af1cf78f9c698a524a61479.tar.bz2 |
remoting: Update calls froms RunAllPending() to RunUntilIdle().
BUG=131220
TEST=remoting_unittests
R=sergeyu@chromium.org,wez@chromium.org
Review URL: https://chromiumcodereview.appspot.com/11364031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165528 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/host/heartbeat_sender_unittest.cc | 18 | ||||
-rw-r--r-- | remoting/host/host_key_pair_unittest.cc | 2 | ||||
-rw-r--r-- | remoting/host/register_support_host_request_unittest.cc | 4 | ||||
-rw-r--r-- | remoting/jingle_glue/iq_sender_unittest.cc | 6 | ||||
-rw-r--r-- | remoting/protocol/buffered_socket_writer_unittest.cc | 4 | ||||
-rw-r--r-- | remoting/protocol/channel_multiplexer_unittest.cc | 8 | ||||
-rw-r--r-- | remoting/protocol/connection_to_client_unittest.cc | 14 | ||||
-rw-r--r-- | remoting/protocol/jingle_session_unittest.cc | 6 | ||||
-rw-r--r-- | remoting/protocol/message_reader_unittest.cc | 24 |
9 files changed, 43 insertions, 43 deletions
diff --git a/remoting/host/heartbeat_sender_unittest.cc b/remoting/host/heartbeat_sender_unittest.cc index 63b4499..4d050d7d 100644 --- a/remoting/host/heartbeat_sender_unittest.cc +++ b/remoting/host/heartbeat_sender_unittest.cc @@ -98,14 +98,14 @@ TEST_F(HeartbeatSenderTest, DoSendStanza) { .WillOnce(DoAll(SaveArg<0>(&sent_iq), Return(true))); heartbeat_sender_->OnSignalStrategyStateChange(SignalStrategy::CONNECTED); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); scoped_ptr<XmlElement> stanza(sent_iq); ASSERT_TRUE(stanza != NULL); ValidateHeartbeatStanza(stanza.get(), "0"); heartbeat_sender_->OnSignalStrategyStateChange(SignalStrategy::DISCONNECTED); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); } // Call Start() followed by Stop(), twice, and make sure two valid heartbeats @@ -120,14 +120,14 @@ TEST_F(HeartbeatSenderTest, DoSendStanzaTwice) { .WillOnce(DoAll(SaveArg<0>(&sent_iq), Return(true))); heartbeat_sender_->OnSignalStrategyStateChange(SignalStrategy::CONNECTED); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); scoped_ptr<XmlElement> stanza(sent_iq); ASSERT_TRUE(stanza != NULL); ValidateHeartbeatStanza(stanza.get(), "0"); heartbeat_sender_->OnSignalStrategyStateChange(SignalStrategy::DISCONNECTED); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); EXPECT_CALL(signal_strategy_, GetLocalJid()) .WillRepeatedly(Return(kTestJid)); @@ -137,13 +137,13 @@ TEST_F(HeartbeatSenderTest, DoSendStanzaTwice) { .WillOnce(DoAll(SaveArg<0>(&sent_iq), Return(true))); heartbeat_sender_->OnSignalStrategyStateChange(SignalStrategy::CONNECTED); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); scoped_ptr<XmlElement> stanza2(sent_iq); ValidateHeartbeatStanza(stanza2.get(), "1"); heartbeat_sender_->OnSignalStrategyStateChange(SignalStrategy::DISCONNECTED); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); } // Call Start() followed by Stop(), make sure a valid Iq stanza is sent, @@ -159,7 +159,7 @@ TEST_F(HeartbeatSenderTest, DoSendStanzaWithExpectedSequenceId) { .WillOnce(DoAll(SaveArg<0>(&sent_iq), Return(true))); heartbeat_sender_->OnSignalStrategyStateChange(SignalStrategy::CONNECTED); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); scoped_ptr<XmlElement> stanza(sent_iq); ASSERT_TRUE(stanza != NULL); @@ -184,7 +184,7 @@ TEST_F(HeartbeatSenderTest, DoSendStanzaWithExpectedSequenceId) { const int kExpectedSequenceId = 456; expected_sequence_id->AddText(base::IntToString(kExpectedSequenceId)); heartbeat_sender_->ProcessResponse(NULL, response.get()); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); scoped_ptr<XmlElement> stanza2(sent_iq2); ASSERT_TRUE(stanza2 != NULL); @@ -192,7 +192,7 @@ TEST_F(HeartbeatSenderTest, DoSendStanzaWithExpectedSequenceId) { base::IntToString(kExpectedSequenceId).c_str()); heartbeat_sender_->OnSignalStrategyStateChange(SignalStrategy::DISCONNECTED); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); } // Verify that ProcessResponse parses set-interval result. diff --git a/remoting/host/host_key_pair_unittest.cc b/remoting/host/host_key_pair_unittest.cc index 06aae2b..a90c1ba 100644 --- a/remoting/host/host_key_pair_unittest.cc +++ b/remoting/host/host_key_pair_unittest.cc @@ -49,7 +49,7 @@ TEST_F(HostKeyPairTest, SaveLoad) { exported_key.LoadFromString(kTestHostKeyPair); exported_key.Save(config_.get()); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); HostKeyPair imported_key; imported_key.Load(*config_); diff --git a/remoting/host/register_support_host_request_unittest.cc b/remoting/host/register_support_host_request_unittest.cc index 4f091b8..0eb1c5f 100644 --- a/remoting/host/register_support_host_request_unittest.cc +++ b/remoting/host/register_support_host_request_unittest.cc @@ -90,7 +90,7 @@ TEST_F(RegisterSupportHostRequestTest, Send) { .WillOnce(DoAll(SaveArg<0>(&sent_iq), Return(true))); request->OnSignalStrategyStateChange(SignalStrategy::CONNECTED); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); // Verify format of the query. scoped_ptr<XmlElement> stanza(sent_iq); @@ -155,7 +155,7 @@ TEST_F(RegisterSupportHostRequestTest, Send) { } EXPECT_EQ(1, consumed); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); } } // namespace remoting diff --git a/remoting/jingle_glue/iq_sender_unittest.cc b/remoting/jingle_glue/iq_sender_unittest.cc index a5f02a5..b09f114 100644 --- a/remoting/jingle_glue/iq_sender_unittest.cc +++ b/remoting/jingle_glue/iq_sender_unittest.cc @@ -102,7 +102,7 @@ TEST_F(IqSenderTest, SendIq) { EXPECT_TRUE(sender_->OnSignalStrategyIncomingStanza(response.get())); EXPECT_CALL(callback_, OnReply(request_.get(), XmlEq(response.get()))); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); } TEST_F(IqSenderTest, Timeout) { @@ -134,7 +134,7 @@ TEST_F(IqSenderTest, InvalidFrom) { EXPECT_CALL(callback_, OnReply(_, _)) .Times(0); EXPECT_FALSE(sender_->OnSignalStrategyIncomingStanza(response.get())); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); } TEST_F(IqSenderTest, IdMatchingHack) { @@ -154,7 +154,7 @@ TEST_F(IqSenderTest, IdMatchingHack) { EXPECT_TRUE(sender_->OnSignalStrategyIncomingStanza(response.get())); EXPECT_CALL(callback_, OnReply(request_.get(), XmlEq(response.get()))); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); } } // namespace remoting diff --git a/remoting/protocol/buffered_socket_writer_unittest.cc b/remoting/protocol/buffered_socket_writer_unittest.cc index 76d0409..e0125f2 100644 --- a/remoting/protocol/buffered_socket_writer_unittest.cc +++ b/remoting/protocol/buffered_socket_writer_unittest.cc @@ -160,7 +160,7 @@ TEST_F(BufferedSocketWriterTest, TestWriteErrorSync) { base::Unretained(this))); socket_->set_next_write_error(net::ERR_FAILED); socket_->set_async_write(false); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); EXPECT_EQ(net::ERR_FAILED, write_error_); EXPECT_EQ(static_cast<size_t>(test_buffer_->size()), socket_->written_data().size()); @@ -175,7 +175,7 @@ TEST_F(BufferedSocketWriterTest, TestWriteErrorAsync) { base::Bind(&BufferedSocketWriterTest::Unexpected, base::Unretained(this))); socket_->set_next_write_error(net::ERR_FAILED); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); EXPECT_EQ(net::ERR_FAILED, write_error_); EXPECT_EQ(static_cast<size_t>(test_buffer_->size()), socket_->written_data().size()); diff --git a/remoting/protocol/channel_multiplexer_unittest.cc b/remoting/protocol/channel_multiplexer_unittest.cc index 781e118..8bfe019 100644 --- a/remoting/protocol/channel_multiplexer_unittest.cc +++ b/remoting/protocol/channel_multiplexer_unittest.cc @@ -260,7 +260,7 @@ TEST_F(ChannelMultiplexerTest, WriteFailSync) { EXPECT_EQ(net::ERR_FAILED, host_socket2_->Write(buf, buf->size(), base::Bind( &MockSocketCallback::OnDone, base::Unretained(&cb2)))); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); } TEST_F(ChannelMultiplexerTest, WriteFailAsync) { @@ -291,7 +291,7 @@ TEST_F(ChannelMultiplexerTest, WriteFailAsync) { host_socket2_->Write(buf, buf->size(), base::Bind( &MockSocketCallback::OnDone, base::Unretained(&cb2)))); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); } TEST_F(ChannelMultiplexerTest, DeleteWhenFailed) { @@ -326,7 +326,7 @@ TEST_F(ChannelMultiplexerTest, DeleteWhenFailed) { host_socket2_->Write(buf, buf->size(), base::Bind( &MockSocketCallback::OnDone, base::Unretained(&cb2)))); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); // Check that the sockets were destroyed. EXPECT_FALSE(host_mux_.get()); @@ -351,7 +351,7 @@ TEST_F(ChannelMultiplexerTest, SessionFail) { EXPECT_CALL(cb2, OnConnectedPtr(_)) .Times(0); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); } } // namespace protocol diff --git a/remoting/protocol/connection_to_client_unittest.cc b/remoting/protocol/connection_to_client_unittest.cc index 5638728..a978e08 100644 --- a/remoting/protocol/connection_to_client_unittest.cc +++ b/remoting/protocol/connection_to_client_unittest.cc @@ -38,12 +38,12 @@ class ConnectionToClientTest : public testing::Test { EXPECT_CALL(handler_, OnConnectionChannelsConnected(viewer_.get())); session_->event_handler()->OnSessionStateChange(Session::CONNECTED); session_->event_handler()->OnSessionStateChange(Session::AUTHENTICATED); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); } virtual void TearDown() OVERRIDE { viewer_.reset(); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); } MessageLoop message_loop_; @@ -64,7 +64,7 @@ TEST_F(ConnectionToClientTest, SendUpdateStream) { scoped_ptr<VideoPacket> packet(new VideoPacket()); viewer_->video_stub()->ProcessVideoPacket(packet.Pass(), base::Closure()); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); // Verify that something has been written. // TODO(sergeyu): Verify that the correct data has been written. @@ -75,7 +75,7 @@ TEST_F(ConnectionToClientTest, SendUpdateStream) { // And then close the connection to ConnectionToClient. viewer_->Disconnect(); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); } TEST_F(ConnectionToClientTest, NoWriteAfterDisconnect) { @@ -88,18 +88,18 @@ TEST_F(ConnectionToClientTest, NoWriteAfterDisconnect) { // The test will crash if data writer tries to write data to the // channel socket. // TODO(sergeyu): Use MockSession to verify that no data is written? - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); } TEST_F(ConnectionToClientTest, StateChange) { EXPECT_CALL(handler_, OnConnectionClosed(viewer_.get(), OK)); session_->event_handler()->OnSessionStateChange(Session::CLOSED); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); EXPECT_CALL(handler_, OnConnectionClosed(viewer_.get(), SESSION_REJECTED)); session_->set_error(SESSION_REJECTED); session_->event_handler()->OnSessionStateChange(Session::FAILED); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); } } // namespace protocol diff --git a/remoting/protocol/jingle_session_unittest.cc b/remoting/protocol/jingle_session_unittest.cc index 809dd65..433356b 100644 --- a/remoting/protocol/jingle_session_unittest.cc +++ b/remoting/protocol/jingle_session_unittest.cc @@ -117,7 +117,7 @@ class JingleSessionTest : public testing::Test { virtual void TearDown() { CloseSessions(); CloseSessionManager(); - message_loop_->RunAllPending(); + message_loop_->RunUntilIdle(); } void CloseSessions() { @@ -224,7 +224,7 @@ class JingleSessionTest : public testing::Test { CandidateSessionConfig::CreateDefault()); client_session_->SetEventHandler(&client_session_event_handler_); - message_loop_->RunAllPending(); + message_loop_->RunUntilIdle(); } void CreateChannel() { @@ -307,7 +307,7 @@ TEST_F(JingleSessionTest, RejectConnection) { kHostJid, authenticator.Pass(), CandidateSessionConfig::CreateDefault()); client_session_->SetEventHandler(&client_session_event_handler_); - message_loop_->RunAllPending(); + message_loop_->RunUntilIdle(); } // Verify that we can connect two endpoints with single-step authentication. diff --git a/remoting/protocol/message_reader_unittest.cc b/remoting/protocol/message_reader_unittest.cc index b3e6289..59e22f2 100644 --- a/remoting/protocol/message_reader_unittest.cc +++ b/remoting/protocol/message_reader_unittest.cc @@ -117,7 +117,7 @@ TEST_F(MessageReaderTest, OneMessage_Delay) { .WillOnce(SaveArg<0>(&done_task)); InitReader(); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); Mock::VerifyAndClearExpectations(&callback_); Mock::VerifyAndClearExpectations(&socket_); @@ -142,7 +142,7 @@ TEST_F(MessageReaderTest, OneMessage_Instant) { .WillOnce(CallDoneTask()); InitReader(); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); EXPECT_TRUE(socket_.read_pending()); EXPECT_EQ(1U, messages_.size()); @@ -162,7 +162,7 @@ TEST_F(MessageReaderTest, TwoMessages_Together) { .WillOnce(SaveArg<0>(&done_task2)); InitReader(); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); Mock::VerifyAndClearExpectations(&callback_); Mock::VerifyAndClearExpectations(&socket_); @@ -175,12 +175,12 @@ TEST_F(MessageReaderTest, TwoMessages_Together) { EXPECT_FALSE(socket_.read_pending()); done_task1.Run(); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); EXPECT_FALSE(socket_.read_pending()); done_task2.Run(); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); EXPECT_TRUE(socket_.read_pending()); } @@ -199,7 +199,7 @@ TEST_F(MessageReaderTest, TwoMessages_Instant) { .WillOnce(SaveArg<0>(&done_task2)); InitReader(); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); Mock::VerifyAndClearExpectations(&callback_); Mock::VerifyAndClearExpectations(&socket_); @@ -227,7 +227,7 @@ TEST_F(MessageReaderTest, TwoMessages_Instant2) { .WillOnce(CallDoneTask()); InitReader(); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); EXPECT_TRUE(socket_.read_pending()); } @@ -243,7 +243,7 @@ TEST_F(MessageReaderTest, TwoMessages_Separately) { .WillOnce(SaveArg<0>(&done_task)); InitReader(); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); Mock::VerifyAndClearExpectations(&callback_); Mock::VerifyAndClearExpectations(&socket_); @@ -255,7 +255,7 @@ TEST_F(MessageReaderTest, TwoMessages_Separately) { EXPECT_FALSE(socket_.read_pending()); done_task.Run(); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); EXPECT_TRUE(socket_.read_pending()); @@ -264,7 +264,7 @@ TEST_F(MessageReaderTest, TwoMessages_Separately) { .Times(1) .WillOnce(SaveArg<0>(&done_task)); AddMessage(kTestMessage2); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); EXPECT_TRUE(CompareResult(messages_[1], kTestMessage2)); @@ -300,7 +300,7 @@ TEST_F(MessageReaderTest, ReadFromCallback) { .WillOnce(Invoke(this, &MessageReaderTest::OnSecondMessage)); InitReader(); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); EXPECT_TRUE(socket_.read_pending()); } @@ -319,7 +319,7 @@ TEST_F(MessageReaderTest, DeleteFromCallback) { .WillOnce(Invoke(this, &MessageReaderTest::DeleteReader)); InitReader(); - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); } } // namespace protocol |