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

Side by Side Diff: media/cast/sender/video_sender_unittest.cc

Issue 623263003: replace OVERRIDE and FINAL with override and 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
« no previous file with comments | « media/cast/sender/video_sender.h ('k') | media/cast/sender/vp8_encoder.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 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 <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 class TestPacketSender : public PacketSender { 59 class TestPacketSender : public PacketSender {
60 public: 60 public:
61 TestPacketSender() 61 TestPacketSender()
62 : number_of_rtp_packets_(0), 62 : number_of_rtp_packets_(0),
63 number_of_rtcp_packets_(0), 63 number_of_rtcp_packets_(0),
64 paused_(false) {} 64 paused_(false) {}
65 65
66 // A singular packet implies a RTCP packet. 66 // A singular packet implies a RTCP packet.
67 virtual bool SendPacket(PacketRef packet, 67 virtual bool SendPacket(PacketRef packet,
68 const base::Closure& cb) OVERRIDE { 68 const base::Closure& cb) override {
69 if (paused_) { 69 if (paused_) {
70 stored_packet_ = packet; 70 stored_packet_ = packet;
71 callback_ = cb; 71 callback_ = cb;
72 return false; 72 return false;
73 } 73 }
74 if (Rtcp::IsRtcpPacket(&packet->data[0], packet->data.size())) { 74 if (Rtcp::IsRtcpPacket(&packet->data[0], packet->data.size())) {
75 ++number_of_rtcp_packets_; 75 ++number_of_rtcp_packets_;
76 } else { 76 } else {
77 // Check that at least one RTCP packet was sent before the first RTP 77 // Check that at least one RTCP packet was sent before the first RTP
78 // packet. This confirms that the receiver will have the necessary lip 78 // packet. This confirms that the receiver will have the necessary lip
79 // sync info before it has to calculate the playout time of the first 79 // sync info before it has to calculate the playout time of the first
80 // frame. 80 // frame.
81 if (number_of_rtp_packets_ == 0) 81 if (number_of_rtp_packets_ == 0)
82 EXPECT_LE(1, number_of_rtcp_packets_); 82 EXPECT_LE(1, number_of_rtcp_packets_);
83 ++number_of_rtp_packets_; 83 ++number_of_rtp_packets_;
84 } 84 }
85 return true; 85 return true;
86 } 86 }
87 87
88 virtual int64 GetBytesSent() OVERRIDE { 88 virtual int64 GetBytesSent() override {
89 return 0; 89 return 0;
90 } 90 }
91 91
92 int number_of_rtp_packets() const { return number_of_rtp_packets_; } 92 int number_of_rtp_packets() const { return number_of_rtp_packets_; }
93 93
94 int number_of_rtcp_packets() const { return number_of_rtcp_packets_; } 94 int number_of_rtcp_packets() const { return number_of_rtcp_packets_; }
95 95
96 void SetPause(bool paused) { 96 void SetPause(bool paused) {
97 paused_ = paused; 97 paused_ = paused;
98 if (!paused && stored_packet_.get()) { 98 if (!paused && stored_packet_.get()) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 make_scoped_ptr(new base::DictionaryValue), 153 make_scoped_ptr(new base::DictionaryValue),
154 base::Bind(&UpdateCastTransportStatus), 154 base::Bind(&UpdateCastTransportStatus),
155 BulkRawEventsCallback(), 155 BulkRawEventsCallback(),
156 base::TimeDelta(), 156 base::TimeDelta(),
157 task_runner_, 157 task_runner_,
158 &transport_)); 158 &transport_));
159 } 159 }
160 160
161 virtual ~VideoSenderTest() {} 161 virtual ~VideoSenderTest() {}
162 162
163 virtual void TearDown() OVERRIDE { 163 virtual void TearDown() override {
164 video_sender_.reset(); 164 video_sender_.reset();
165 task_runner_->RunTasks(); 165 task_runner_->RunTasks();
166 } 166 }
167 167
168 static void UpdateCastTransportStatus(CastTransportStatus status) { 168 static void UpdateCastTransportStatus(CastTransportStatus status) {
169 EXPECT_EQ(TRANSPORT_VIDEO_INITIALIZED, status); 169 EXPECT_EQ(TRANSPORT_VIDEO_INITIALIZED, status);
170 } 170 }
171 171
172 // If |external| is true then external video encoder (VEA) is used. 172 // If |external| is true then external video encoder (VEA) is used.
173 // |expect_init_sucess| is true if initialization is expected to succeed. 173 // |expect_init_sucess| is true if initialization is expected to succeed.
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 cast_feedback.ack_frame_id = 0; 527 cast_feedback.ack_frame_id = 0;
528 video_sender_->OnReceivedCastFeedback(cast_feedback); 528 video_sender_->OnReceivedCastFeedback(cast_feedback);
529 529
530 transport_.SetPause(false); 530 transport_.SetPause(false);
531 RunTasks(33); 531 RunTasks(33);
532 EXPECT_EQ(0, transport_.number_of_rtp_packets()); 532 EXPECT_EQ(0, transport_.number_of_rtp_packets());
533 } 533 }
534 534
535 } // namespace cast 535 } // namespace cast
536 } // namespace media 536 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/sender/video_sender.h ('k') | media/cast/sender/vp8_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698