diff options
Diffstat (limited to 'remoting/protocol')
-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 |
5 files changed, 28 insertions, 28 deletions
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 |