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

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

Issue 174183003: Cast:Transport: Dividing A/V Initialization pipeline (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixing errors and yet another rebase Created 6 years, 9 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
« no previous file with comments | « media/cast/transport/transport_video_sender.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 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_); 83 task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_);
84 cast_environment_ = 84 cast_environment_ =
85 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_).Pass(), 85 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_).Pass(),
86 task_runner_, 86 task_runner_,
87 task_runner_, 87 task_runner_,
88 task_runner_, 88 task_runner_,
89 task_runner_, 89 task_runner_,
90 task_runner_, 90 task_runner_,
91 task_runner_, 91 task_runner_,
92 GetLoggingConfigWithRawEventsAndStatsEnabled()); 92 GetLoggingConfigWithRawEventsAndStatsEnabled());
93 transport::CastTransportConfig transport_config; 93 transport::CastTransportVideoConfig transport_config;
94 net::IPEndPoint dummy_endpoint;
94 transport_sender_.reset(new transport::CastTransportSenderImpl( 95 transport_sender_.reset(new transport::CastTransportSenderImpl(
95 NULL, 96 NULL,
96 testing_clock_, 97 testing_clock_,
97 transport_config, 98 dummy_endpoint,
99 dummy_endpoint,
98 base::Bind(&UpdateCastTransportStatus), 100 base::Bind(&UpdateCastTransportStatus),
99 task_runner_, 101 task_runner_,
100 &transport_)); 102 &transport_));
103 transport_sender_->InitializeVideo(transport_config);
101 } 104 }
102 105
103 virtual ~VideoSenderTest() {} 106 virtual ~VideoSenderTest() {}
104 107
105 virtual void TearDown() OVERRIDE { 108 virtual void TearDown() OVERRIDE {
106 video_sender_.reset(); 109 video_sender_.reset();
107 task_runner_->RunTasks(); 110 task_runner_->RunTasks();
108 } 111 }
109 112
110 static void UpdateCastTransportStatus(transport::CastTransportStatus status) { 113 static void UpdateCastTransportStatus(transport::CastTransportStatus status) {
111 EXPECT_EQ(status, transport::TRANSPORT_INITIALIZED); 114 EXPECT_EQ(status, transport::TRANSPORT_VIDEO_INITIALIZED);
112 } 115 }
113 116
114 void InitEncoder(bool external) { 117 void InitEncoder(bool external) {
115 VideoSenderConfig video_config; 118 VideoSenderConfig video_config;
116 video_config.sender_ssrc = 1; 119 video_config.sender_ssrc = 1;
117 video_config.incoming_feedback_ssrc = 2; 120 video_config.incoming_feedback_ssrc = 2;
118 video_config.rtcp_c_name = "video_test@10.1.1.1"; 121 video_config.rtcp_c_name = "video_test@10.1.1.1";
119 video_config.rtp_config.payload_type = 127; 122 video_config.rtp_config.payload_type = 127;
120 video_config.use_external_encoder = external; 123 video_config.use_external_encoder = external;
121 video_config.width = kWidth; 124 video_config.width = kWidth;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 // Empty the pipeline. 330 // Empty the pipeline.
328 RunTasks(100); 331 RunTasks(100);
329 // Should have sent at least 7 packets. 332 // Should have sent at least 7 packets.
330 EXPECT_GE( 333 EXPECT_GE(
331 transport_.number_of_rtp_packets() + transport_.number_of_rtcp_packets(), 334 transport_.number_of_rtp_packets() + transport_.number_of_rtcp_packets(),
332 7); 335 7);
333 } 336 }
334 337
335 } // namespace cast 338 } // namespace cast
336 } // namespace media 339 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/transport/transport_video_sender.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698