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

Side by Side Diff: media/cast/net/rtcp/rtcp_utility_unittest.cc

Issue 499433002: Minor code redundancy cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years, 4 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 | « media/cast/net/rtcp/rtcp_utility.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/test/simple_test_tick_clock.h" 6 #include "base/test/simple_test_tick_clock.h"
7 #include "media/cast/cast_environment.h" 7 #include "media/cast/cast_environment.h"
8 #include "media/cast/net/cast_transport_defines.h" 8 #include "media/cast/net/cast_transport_defines.h"
9 #include "media/cast/net/rtcp/rtcp_utility.h" 9 #include "media/cast/net/rtcp/rtcp_utility.h"
10 #include "media/cast/net/rtcp/test_rtcp_packet_builder.h" 10 #include "media/cast/net/rtcp/test_rtcp_packet_builder.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // Expected to be ignored since the source ssrc does not match our 240 // Expected to be ignored since the source ssrc does not match our
241 // local ssrc. 241 // local ssrc.
242 RtcpParser parser1(kSourceSsrc, 0); 242 RtcpParser parser1(kSourceSsrc, 0);
243 EXPECT_TRUE(parser1.Parse(p.Reader())); 243 EXPECT_TRUE(parser1.Parse(p.Reader()));
244 EXPECT_FALSE(HasAnything(parser1)); 244 EXPECT_FALSE(HasAnything(parser1));
245 245
246 // Expected to be pass through since the sender ssrc match our local ssrc. 246 // Expected to be pass through since the sender ssrc match our local ssrc.
247 RtcpParser parser2(kSourceSsrc, kSenderSsrc); 247 RtcpParser parser2(kSourceSsrc, kSenderSsrc);
248 EXPECT_TRUE(parser2.Parse(p.Reader())); 248 EXPECT_TRUE(parser2.Parse(p.Reader()));
249 ExpectSenderInfo(parser2); 249 ExpectSenderInfo(parser2);
250 ExpectLastReport(parser2); 250 // DLRRs are ignored.
251 EXPECT_FALSE(parser2.has_last_report());
251 } 252 }
252 253
253 TEST_F(RtcpParserTest, InjectReceiverReportPacketWithRrtr) { 254 TEST_F(RtcpParserTest, InjectReceiverReportPacketWithRrtr) {
254 TestRtcpPacketBuilder p1; 255 TestRtcpPacketBuilder p1;
255 p1.AddRr(kSenderSsrc, 1); 256 p1.AddRr(kSenderSsrc, 1);
256 p1.AddRb(kUnknownSsrc); 257 p1.AddRb(kUnknownSsrc);
257 p1.AddXrHeader(kSenderSsrc); 258 p1.AddXrHeader(kSenderSsrc);
258 p1.AddXrRrtrBlock(); 259 p1.AddXrRrtrBlock();
259 260
260 // Expected to be ignored since the source ssrc does not match our 261 // Expected to be ignored since the source ssrc does not match our
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 p.AddReceiverEventLog(kDelayDeltaMs, FRAME_ACK_SENT, 0); 393 p.AddReceiverEventLog(kDelayDeltaMs, FRAME_ACK_SENT, 0);
393 } 394 }
394 395
395 RtcpParser parser(kSourceSsrc, kSenderSsrc); 396 RtcpParser parser(kSourceSsrc, kSenderSsrc);
396 EXPECT_TRUE(parser.Parse(p.Reader())); 397 EXPECT_TRUE(parser.Parse(p.Reader()));
397 ExpectReceiverLog(parser, receiver_log); 398 ExpectReceiverLog(parser, receiver_log);
398 } 399 }
399 400
400 } // namespace cast 401 } // namespace cast
401 } // namespace media 402 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/net/rtcp/rtcp_utility.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698