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

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

Issue 7218061: Close all writers before JingleSession is destroyed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 9 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 | Annotate | Revision Log
« no previous file with comments | « remoting/protocol/rtcp_writer.cc ('k') | remoting/protocol/rtp_video_writer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <vector> 5 #include <vector>
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "net/base/io_buffer.h" 9 #include "net/base/io_buffer.h"
10 #include "remoting/proto/video.pb.h" 10 #include "remoting/proto/video.pb.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 int expected_size = expected[i].end - expected[i].start; 120 int expected_size = expected[i].end - expected[i].start;
121 EXPECT_EQ(expected_size, 121 EXPECT_EQ(expected_size,
122 static_cast<int>(received_packets_[i].data().size())); 122 static_cast<int>(received_packets_[i].data().size()));
123 EXPECT_EQ(0, memcmp(&*received_packets_[i].data().data(), 123 EXPECT_EQ(0, memcmp(&*received_packets_[i].data().data(),
124 &*data_.begin() + expected[i].start, expected_size)); 124 &*data_.begin() + expected[i].start, expected_size));
125 EXPECT_EQ(expected[i].flags, received_packets_[i].flags()); 125 EXPECT_EQ(expected[i].flags, received_packets_[i].flags());
126 EXPECT_EQ(expected[i].timestamp, received_packets_[i].timestamp()); 126 EXPECT_EQ(expected[i].timestamp, received_packets_[i].timestamp());
127 } 127 }
128 } 128 }
129 129
130 MessageLoop message_loop_;
131
130 scoped_refptr<FakeSession> session_; 132 scoped_refptr<FakeSession> session_;
131 scoped_ptr<RtpVideoReader> reader_; 133 scoped_ptr<RtpVideoReader> reader_;
132 134
133 MessageLoop message_loop_;
134 vector<char> data_; 135 vector<char> data_;
135 vector<VideoPacket> received_packets_; 136 vector<VideoPacket> received_packets_;
136 }; 137 };
137 138
138 // One non-fragmented packet marked as first. 139 // One non-fragmented packet marked as first.
139 TEST_F(RtpVideoReaderTest, NotFragmented_FirstPacket) { 140 TEST_F(RtpVideoReaderTest, NotFragmented_FirstPacket) {
140 FragmentInfo fragments[] = { 141 FragmentInfo fragments[] = {
141 { 300, 123, true, false, Vp8Descriptor::NOT_FRAGMENTED, 0, 100 }, 142 { 300, 123, true, false, Vp8Descriptor::NOT_FRAGMENTED, 0, 100 },
142 }; 143 };
143 SplitAndSend(fragments, arraysize(fragments)); 144 SplitAndSend(fragments, arraysize(fragments));
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 361
361 ExpectedPacket expected[] = { 362 ExpectedPacket expected[] = {
362 { 123, VideoPacket::FIRST_PACKET | VideoPacket::LAST_PACKET, 0, 30 }, 363 { 123, VideoPacket::FIRST_PACKET | VideoPacket::LAST_PACKET, 0, 30 },
363 { 223, VideoPacket::FIRST_PACKET | VideoPacket::LAST_PACKET, 40, 50 }, 364 { 223, VideoPacket::FIRST_PACKET | VideoPacket::LAST_PACKET, 40, 50 },
364 }; 365 };
365 CheckResults(expected, arraysize(expected)); 366 CheckResults(expected, arraysize(expected));
366 } 367 }
367 368
368 } // namespace protocol 369 } // namespace protocol
369 } // namespace remoting 370 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/rtcp_writer.cc ('k') | remoting/protocol/rtp_video_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698