| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/protocol/client_video_dispatcher.h" | 5 #include "remoting/protocol/client_video_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 kDefaultStreamVersion, | 69 kDefaultStreamVersion, |
| 70 ChannelConfig::CODEC_UNDEFINED), | 70 ChannelConfig::CODEC_UNDEFINED), |
| 71 this); | 71 this); |
| 72 base::RunLoop().RunUntilIdle(); | 72 base::RunLoop().RunUntilIdle(); |
| 73 DCHECK(initialized_); | 73 DCHECK(initialized_); |
| 74 host_socket_.PairWith( | 74 host_socket_.PairWith( |
| 75 session_.fake_channel_factory().GetFakeChannel(kVideoChannelName)); | 75 session_.fake_channel_factory().GetFakeChannel(kVideoChannelName)); |
| 76 reader_.StartReading(&host_socket_, | 76 reader_.StartReading(&host_socket_, |
| 77 base::Bind(&ClientVideoDispatcherTest::OnReadError, | 77 base::Bind(&ClientVideoDispatcherTest::OnReadError, |
| 78 base::Unretained(this))); | 78 base::Unretained(this))); |
| 79 writer_.Init(&host_socket_, BufferedSocketWriter::WriteFailedCallback()); | 79 writer_.Init( |
| 80 base::Bind(&P2PStreamSocket::Write, base::Unretained(&host_socket_)), |
| 81 BufferedSocketWriter::WriteFailedCallback()); |
| 80 } | 82 } |
| 81 | 83 |
| 82 void ClientVideoDispatcherTest::ProcessVideoPacket( | 84 void ClientVideoDispatcherTest::ProcessVideoPacket( |
| 83 scoped_ptr<VideoPacket> video_packet, | 85 scoped_ptr<VideoPacket> video_packet, |
| 84 const base::Closure& done) { | 86 const base::Closure& done) { |
| 85 video_packets_.push_back(video_packet.release()); | 87 video_packets_.push_back(video_packet.release()); |
| 86 packet_done_callbacks_.push_back(done); | 88 packet_done_callbacks_.push_back(done); |
| 87 } | 89 } |
| 88 | 90 |
| 89 void ClientVideoDispatcherTest::OnChannelInitialized( | 91 void ClientVideoDispatcherTest::OnChannelInitialized( |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 base::RunLoop().RunUntilIdle(); | 180 base::RunLoop().RunUntilIdle(); |
| 179 | 181 |
| 180 // Verify order of Ack messages. | 182 // Verify order of Ack messages. |
| 181 ASSERT_EQ(2U, ack_messages_.size()); | 183 ASSERT_EQ(2U, ack_messages_.size()); |
| 182 EXPECT_EQ(kTestFrameId, ack_messages_[0]->frame_id()); | 184 EXPECT_EQ(kTestFrameId, ack_messages_[0]->frame_id()); |
| 183 EXPECT_EQ(kTestFrameId + 1, ack_messages_[1]->frame_id()); | 185 EXPECT_EQ(kTestFrameId + 1, ack_messages_[1]->frame_id()); |
| 184 } | 186 } |
| 185 | 187 |
| 186 } // namespace protocol | 188 } // namespace protocol |
| 187 } // namespace remoting | 189 } // namespace remoting |
| OLD | NEW |