Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: remoting/protocol/client_video_dispatcher_unittest.cc

Issue 1420273002: Add TransportSession interface to prepare for WebRTC-based transport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(
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
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
OLDNEW
« no previous file with comments | « remoting/protocol/channel_multiplexer_unittest.cc ('k') | remoting/protocol/connection_to_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698