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

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

Issue 163553006: Cast: Refactoring Cast API's (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Responding to review Created 6 years, 10 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/test/simple_test_tick_clock.h" 9 #include "base/test/simple_test_tick_clock.h"
10 #include "media/base/video_frame.h" 10 #include "media/base/video_frame.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 void RunTasks(int during_ms) { 160 void RunTasks(int during_ms) {
161 for (int i = 0; i < during_ms; ++i) { 161 for (int i = 0; i < during_ms; ++i) {
162 // Call process the timers every 1 ms. 162 // Call process the timers every 1 ms.
163 testing_clock_->Advance(base::TimeDelta::FromMilliseconds(1)); 163 testing_clock_->Advance(base::TimeDelta::FromMilliseconds(1));
164 task_runner_->RunTasks(); 164 task_runner_->RunTasks();
165 } 165 }
166 } 166 }
167 167
168 void InitializationResult(CastInitializationStatus result) { 168 void InitializationResult(CastInitializationStatus result) {
169 EXPECT_EQ(result, STATUS_INITIALIZED); 169 EXPECT_EQ(result, STATUS_VIDEO_INITIALIZED);
170 } 170 }
171 171
172 base::SimpleTestTickClock* testing_clock_; // Owned by CastEnvironment. 172 base::SimpleTestTickClock* testing_clock_; // Owned by CastEnvironment.
173 TestPacketSender transport_; 173 TestPacketSender transport_;
174 scoped_ptr<transport::CastTransportSenderImpl> transport_sender_; 174 scoped_ptr<transport::CastTransportSenderImpl> transport_sender_;
175 scoped_refptr<test::FakeSingleThreadTaskRunner> task_runner_; 175 scoped_refptr<test::FakeSingleThreadTaskRunner> task_runner_;
176 scoped_ptr<PeerVideoSender> video_sender_; 176 scoped_ptr<PeerVideoSender> video_sender_;
177 scoped_refptr<CastEnvironment> cast_environment_; 177 scoped_refptr<CastEnvironment> cast_environment_;
178 178
179 DISALLOW_COPY_AND_ASSIGN(VideoSenderTest); 179 DISALLOW_COPY_AND_ASSIGN(VideoSenderTest);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 // Make sure that we do a re-send. 248 // Make sure that we do a re-send.
249 RunTasks(max_resend_timeout.InMilliseconds()); 249 RunTasks(max_resend_timeout.InMilliseconds());
250 // Should have sent at least 3 packets. 250 // Should have sent at least 3 packets.
251 EXPECT_GE( 251 EXPECT_GE(
252 transport_.number_of_rtp_packets() + transport_.number_of_rtcp_packets(), 252 transport_.number_of_rtp_packets() + transport_.number_of_rtcp_packets(),
253 3); 253 3);
254 } 254 }
255 255
256 } // namespace cast 256 } // namespace cast
257 } // namespace media 257 } // namespace media
OLDNEW
« media/cast/video_sender/video_sender.cc ('K') | « media/cast/video_sender/video_sender.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698