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

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

Issue 1582583003: Fix BufferedSocketWriter to buffer everything before it starts writing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « remoting/protocol/channel_multiplexer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
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
OLDNEW
« no previous file with comments | « remoting/protocol/channel_multiplexer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698