Chromium Code Reviews| 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 parser_(base::Bind(&ClientVideoDispatcherTest::OnVideoAck, | 66 parser_(base::Bind(&ClientVideoDispatcherTest::OnVideoAck, |
| 67 base::Unretained(this)), | 67 base::Unretained(this)), |
| 68 &reader_) { | 68 &reader_) { |
| 69 dispatcher_.Init(&session_, ChannelConfig(ChannelConfig::TRANSPORT_MUX_STREAM, | 69 dispatcher_.Init(&session_, ChannelConfig(ChannelConfig::TRANSPORT_MUX_STREAM, |
| 70 kDefaultStreamVersion, | 70 kDefaultStreamVersion, |
| 71 ChannelConfig::CODEC_UNDEFINED), | 71 ChannelConfig::CODEC_UNDEFINED), |
| 72 this); | 72 this); |
| 73 base::RunLoop().RunUntilIdle(); | 73 base::RunLoop().RunUntilIdle(); |
| 74 DCHECK(initialized_); | 74 DCHECK(initialized_); |
| 75 host_socket_.PairWith( | 75 host_socket_.PairWith( |
| 76 session_.fake_channel_factory().GetFakeChannel(kVideoChannelName)); | 76 session_.GetTransportSession()->GetStreamChannelFactory()->GetFakeChannel( |
|
Jamie
2015/10/27 21:32:27
Break before GetFakeChannel, for consistency with
Sergey Ulanov
2015/10/27 23:03:58
This is the way clang-format formats this code.
| |
| 77 kVideoChannelName)); | |
| 77 reader_.StartReading(&host_socket_, | 78 reader_.StartReading(&host_socket_, |
| 78 base::Bind(&ClientVideoDispatcherTest::OnReadError, | 79 base::Bind(&ClientVideoDispatcherTest::OnReadError, |
| 79 base::Unretained(this))); | 80 base::Unretained(this))); |
| 80 writer_.Init( | 81 writer_.Init( |
| 81 base::Bind(&P2PStreamSocket::Write, base::Unretained(&host_socket_)), | 82 base::Bind(&P2PStreamSocket::Write, base::Unretained(&host_socket_)), |
| 82 BufferedSocketWriter::WriteFailedCallback()); | 83 BufferedSocketWriter::WriteFailedCallback()); |
| 83 } | 84 } |
| 84 | 85 |
| 85 void ClientVideoDispatcherTest::ProcessVideoPacket( | 86 void ClientVideoDispatcherTest::ProcessVideoPacket( |
| 86 scoped_ptr<VideoPacket> video_packet, | 87 scoped_ptr<VideoPacket> video_packet, |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 base::RunLoop().RunUntilIdle(); | 182 base::RunLoop().RunUntilIdle(); |
| 182 | 183 |
| 183 // Verify order of Ack messages. | 184 // Verify order of Ack messages. |
| 184 ASSERT_EQ(2U, ack_messages_.size()); | 185 ASSERT_EQ(2U, ack_messages_.size()); |
| 185 EXPECT_EQ(kTestFrameId, ack_messages_[0]->frame_id()); | 186 EXPECT_EQ(kTestFrameId, ack_messages_[0]->frame_id()); |
| 186 EXPECT_EQ(kTestFrameId + 1, ack_messages_[1]->frame_id()); | 187 EXPECT_EQ(kTestFrameId + 1, ack_messages_[1]->frame_id()); |
| 187 } | 188 } |
| 188 | 189 |
| 189 } // namespace protocol | 190 } // namespace protocol |
| 190 } // namespace remoting | 191 } // namespace remoting |
| OLD | NEW |