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

Side by Side Diff: media/cast/net/rtp/receiver_stats_unittest.cc

Issue 661163004: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « media/cast/net/rtp/framer_unittest.cc ('k') | media/cast/net/rtp/rtp_parser_unittest.cc » ('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 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 <gtest/gtest.h> 5 #include <gtest/gtest.h>
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/test/simple_test_tick_clock.h" 9 #include "base/test/simple_test_tick_clock.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 12 matching lines...) Expand all
23 : stats_(&testing_clock_), 23 : stats_(&testing_clock_),
24 fraction_lost_(0), 24 fraction_lost_(0),
25 cumulative_lost_(0), 25 cumulative_lost_(0),
26 extended_high_sequence_number_(0), 26 extended_high_sequence_number_(0),
27 jitter_(0) { 27 jitter_(0) {
28 testing_clock_.Advance( 28 testing_clock_.Advance(
29 base::TimeDelta::FromMilliseconds(kStartMillisecond)); 29 base::TimeDelta::FromMilliseconds(kStartMillisecond));
30 start_time_ = testing_clock_.NowTicks(); 30 start_time_ = testing_clock_.NowTicks();
31 delta_increments_ = base::TimeDelta::FromMilliseconds(kStdTimeIncrementMs); 31 delta_increments_ = base::TimeDelta::FromMilliseconds(kStdTimeIncrementMs);
32 } 32 }
33 virtual ~ReceiverStatsTest() {} 33 ~ReceiverStatsTest() override {}
34 34
35 uint32 ExpectedJitter(uint32 const_interval, int num_packets) { 35 uint32 ExpectedJitter(uint32 const_interval, int num_packets) {
36 float jitter = 0; 36 float jitter = 0;
37 // Assume timestamps have a constant kStdTimeIncrementMs interval. 37 // Assume timestamps have a constant kStdTimeIncrementMs interval.
38 float float_interval = 38 float float_interval =
39 static_cast<float>(const_interval - kStdTimeIncrementMs); 39 static_cast<float>(const_interval - kStdTimeIncrementMs);
40 for (int i = 0; i < num_packets; ++i) { 40 for (int i = 0; i < num_packets; ++i) {
41 jitter += (float_interval - jitter) / 16; 41 jitter += (float_interval - jitter) / 16;
42 } 42 }
43 return static_cast<uint32>(jitter + 0.5f); 43 return static_cast<uint32>(jitter + 0.5f);
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 EXPECT_FALSE(cumulative_lost_); 169 EXPECT_FALSE(cumulative_lost_);
170 // Build extended sequence number (one wrap cycle). 170 // Build extended sequence number (one wrap cycle).
171 const uint32 extended_seq_num = rtp_header_.sequence_number - 1; 171 const uint32 extended_seq_num = rtp_header_.sequence_number - 1;
172 EXPECT_EQ(extended_seq_num, extended_high_sequence_number_); 172 EXPECT_EQ(extended_seq_num, extended_high_sequence_number_);
173 EXPECT_EQ(ExpectedJitter(kStdTimeIncrementMs + kAdditionalIncrement, 300), 173 EXPECT_EQ(ExpectedJitter(kStdTimeIncrementMs + kAdditionalIncrement, 300),
174 jitter_); 174 jitter_);
175 } 175 }
176 176
177 } // namespace cast 177 } // namespace cast
178 } // namespace media 178 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/net/rtp/framer_unittest.cc ('k') | media/cast/net/rtp/rtp_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698