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

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

Issue 1197853003: Add P2PDatagramSocket and P2PStreamSocket interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698