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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 base::Unretained(this)), | 66 base::Unretained(this)), |
67 &reader_) { | 67 &reader_) { |
68 dispatcher_.Init(&client_channel_factory_, this); | 68 dispatcher_.Init(&client_channel_factory_, this); |
69 base::RunLoop().RunUntilIdle(); | 69 base::RunLoop().RunUntilIdle(); |
70 DCHECK(initialized_); | 70 DCHECK(initialized_); |
71 host_socket_.PairWith( | 71 host_socket_.PairWith( |
72 client_channel_factory_.GetFakeChannel(kVideoChannelName)); | 72 client_channel_factory_.GetFakeChannel(kVideoChannelName)); |
73 reader_.StartReading(&host_socket_, | 73 reader_.StartReading(&host_socket_, |
74 base::Bind(&ClientVideoDispatcherTest::OnReadError, | 74 base::Bind(&ClientVideoDispatcherTest::OnReadError, |
75 base::Unretained(this))); | 75 base::Unretained(this))); |
76 writer_.Init( | 76 writer_.Start( |
77 base::Bind(&P2PStreamSocket::Write, base::Unretained(&host_socket_)), | 77 base::Bind(&P2PStreamSocket::Write, base::Unretained(&host_socket_)), |
78 BufferedSocketWriter::WriteFailedCallback()); | 78 BufferedSocketWriter::WriteFailedCallback()); |
79 } | 79 } |
80 | 80 |
81 void ClientVideoDispatcherTest::ProcessVideoPacket( | 81 void ClientVideoDispatcherTest::ProcessVideoPacket( |
82 scoped_ptr<VideoPacket> video_packet, | 82 scoped_ptr<VideoPacket> video_packet, |
83 const base::Closure& done) { | 83 const base::Closure& done) { |
84 video_packets_.push_back(video_packet.release()); | 84 video_packets_.push_back(video_packet.release()); |
85 packet_done_callbacks_.push_back(done); | 85 packet_done_callbacks_.push_back(done); |
86 } | 86 } |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 base::RunLoop().RunUntilIdle(); | 177 base::RunLoop().RunUntilIdle(); |
178 | 178 |
179 // Verify order of Ack messages. | 179 // Verify order of Ack messages. |
180 ASSERT_EQ(2U, ack_messages_.size()); | 180 ASSERT_EQ(2U, ack_messages_.size()); |
181 EXPECT_EQ(kTestFrameId, ack_messages_[0]->frame_id()); | 181 EXPECT_EQ(kTestFrameId, ack_messages_[0]->frame_id()); |
182 EXPECT_EQ(kTestFrameId + 1, ack_messages_[1]->frame_id()); | 182 EXPECT_EQ(kTestFrameId + 1, ack_messages_[1]->frame_id()); |
183 } | 183 } |
184 | 184 |
185 } // namespace protocol | 185 } // namespace protocol |
186 } // namespace remoting | 186 } // namespace remoting |
OLD | NEW |