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

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

Issue 655713003: Standardize usage of virtual/override/final in media/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/test/simple_test_tick_clock.h" 7 #include "base/test/simple_test_tick_clock.h"
8 #include "media/cast/cast_defines.h" 8 #include "media/cast/cast_defines.h"
9 #include "media/cast/net/cast_transport_config.h" 9 #include "media/cast/net/cast_transport_config.h"
10 #include "media/cast/net/pacing/paced_sender.h" 10 #include "media/cast/net/pacing/paced_sender.h"
(...skipping 14 matching lines...) Expand all
25 public: 25 public:
26 explicit FakeRtcpTransport(base::SimpleTestTickClock* clock) 26 explicit FakeRtcpTransport(base::SimpleTestTickClock* clock)
27 : clock_(clock), 27 : clock_(clock),
28 packet_delay_(base::TimeDelta::FromMilliseconds(42)) {} 28 packet_delay_(base::TimeDelta::FromMilliseconds(42)) {}
29 29
30 void set_rtcp_destination(Rtcp* rtcp) { rtcp_ = rtcp; } 30 void set_rtcp_destination(Rtcp* rtcp) { rtcp_ = rtcp; }
31 31
32 base::TimeDelta packet_delay() const { return packet_delay_; } 32 base::TimeDelta packet_delay() const { return packet_delay_; }
33 void set_packet_delay(base::TimeDelta delay) { packet_delay_ = delay; } 33 void set_packet_delay(base::TimeDelta delay) { packet_delay_ = delay; }
34 34
35 virtual bool SendRtcpPacket(uint32 ssrc, PacketRef packet) override { 35 bool SendRtcpPacket(uint32 ssrc, PacketRef packet) override {
36 clock_->Advance(packet_delay_); 36 clock_->Advance(packet_delay_);
37 rtcp_->IncomingRtcpPacket(&packet->data[0], packet->data.size()); 37 rtcp_->IncomingRtcpPacket(&packet->data[0], packet->data.size());
38 return true; 38 return true;
39 } 39 }
40 40
41 virtual bool SendPackets(const SendPacketVector& packets) override { 41 bool SendPackets(const SendPacketVector& packets) override { return false; }
42
43 bool ResendPackets(const SendPacketVector& packets,
44 const DedupInfo& dedup_info) override {
42 return false; 45 return false;
43 } 46 }
44 47
45 virtual bool ResendPackets( 48 void CancelSendingPacket(const PacketKey& packet_key) override {}
46 const SendPacketVector& packets, const DedupInfo& dedup_info) override {
47 return false;
48 }
49
50 virtual void CancelSendingPacket(const PacketKey& packet_key) override {
51 }
52 49
53 private: 50 private:
54 base::SimpleTestTickClock* const clock_; 51 base::SimpleTestTickClock* const clock_;
55 base::TimeDelta packet_delay_; 52 base::TimeDelta packet_delay_;
56 Rtcp* rtcp_; 53 Rtcp* rtcp_;
57 54
58 DISALLOW_COPY_AND_ASSIGN(FakeRtcpTransport); 55 DISALLOW_COPY_AND_ASSIGN(FakeRtcpTransport);
59 }; 56 };
60 57
61 class FakeReceiverStats : public RtpReceiverStatistics { 58 class FakeReceiverStats : public RtpReceiverStatistics {
62 public: 59 public:
63 FakeReceiverStats() {} 60 FakeReceiverStats() {}
64 virtual ~FakeReceiverStats() {} 61 ~FakeReceiverStats() override {}
65 62
66 virtual void GetStatistics(uint8* fraction_lost, 63 void GetStatistics(uint8* fraction_lost,
67 uint32* cumulative_lost, 64 uint32* cumulative_lost,
68 uint32* extended_high_sequence_number, 65 uint32* extended_high_sequence_number,
69 uint32* jitter) override { 66 uint32* jitter) override {
70 *fraction_lost = 0; 67 *fraction_lost = 0;
71 *cumulative_lost = 0; 68 *cumulative_lost = 0;
72 *extended_high_sequence_number = 0; 69 *extended_high_sequence_number = 0;
73 *jitter = 0; 70 *jitter = 0;
74 } 71 }
75 72
76 private: 73 private:
77 DISALLOW_COPY_AND_ASSIGN(FakeReceiverStats); 74 DISALLOW_COPY_AND_ASSIGN(FakeReceiverStats);
78 }; 75 };
79 76
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 base::TimeTicks out_3 = ConvertNtpToTimeTicks(ntp_seconds_3, ntp_fraction_3); 258 base::TimeTicks out_3 = ConvertNtpToTimeTicks(ntp_seconds_3, ntp_fraction_3);
262 EXPECT_EQ(input_time, out_3); // Verify inverse. 259 EXPECT_EQ(input_time, out_3); // Verify inverse.
263 260
264 // Verify delta. 261 // Verify delta.
265 EXPECT_EQ((out_3 - out_2), time_delta); 262 EXPECT_EQ((out_3 - out_2), time_delta);
266 EXPECT_NEAR((ntp_fraction_3 - ntp_fraction_2), 0xffffffff / 2, 1); 263 EXPECT_NEAR((ntp_fraction_3 - ntp_fraction_2), 0xffffffff / 2, 1);
267 } 264 }
268 265
269 } // namespace cast 266 } // namespace cast
270 } // namespace media 267 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/net/rtcp/receiver_rtcp_event_subscriber.h ('k') | media/cast/net/rtp/cast_message_builder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698