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

Side by Side Diff: media/cast/rtcp/rtcp_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/audio_sender/audio_sender_unittest.cc ('k') | media/cast/test/end2end_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 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 "base/test/simple_test_tick_clock.h" 5 #include "base/test/simple_test_tick_clock.h"
6 #include "media/cast/cast_defines.h" 6 #include "media/cast/cast_defines.h"
7 #include "media/cast/cast_environment.h" 7 #include "media/cast/cast_environment.h"
8 #include "media/cast/rtcp/mock_rtcp_receiver_feedback.h" 8 #include "media/cast/rtcp/mock_rtcp_receiver_feedback.h"
9 #include "media/cast/rtcp/mock_rtcp_sender_feedback.h" 9 #include "media/cast/rtcp/mock_rtcp_sender_feedback.h"
10 #include "media/cast/rtcp/rtcp.h" 10 #include "media/cast/rtcp/rtcp.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 task_runner_, 151 task_runner_,
152 task_runner_, 152 task_runner_,
153 task_runner_, 153 task_runner_,
154 task_runner_, 154 task_runner_,
155 task_runner_, 155 task_runner_,
156 GetDefaultCastSenderLoggingConfig())), 156 GetDefaultCastSenderLoggingConfig())),
157 sender_to_receiver_(testing_clock_), 157 sender_to_receiver_(testing_clock_),
158 receiver_to_sender_(cast_environment_, testing_clock_) { 158 receiver_to_sender_(cast_environment_, testing_clock_) {
159 testing_clock_->Advance( 159 testing_clock_->Advance(
160 base::TimeDelta::FromMilliseconds(kStartMillisecond)); 160 base::TimeDelta::FromMilliseconds(kStartMillisecond));
161 transport::CastTransportConfig transport_config; 161 net::IPEndPoint dummy_endpoint;
162 transport_sender_.reset(new transport::CastTransportSenderImpl( 162 transport_sender_.reset(new transport::CastTransportSenderImpl(
163 NULL, 163 NULL,
164 testing_clock_, 164 testing_clock_,
165 transport_config, 165 dummy_endpoint,
166 dummy_endpoint,
166 base::Bind(&UpdateCastTransportStatus), 167 base::Bind(&UpdateCastTransportStatus),
167 task_runner_, 168 task_runner_,
168 &sender_to_receiver_)); 169 &sender_to_receiver_));
169 EXPECT_CALL(mock_sender_feedback_, OnReceivedCastFeedback(_)).Times(0); 170 EXPECT_CALL(mock_sender_feedback_, OnReceivedCastFeedback(_)).Times(0);
170 } 171 }
171 172
172 virtual ~RtcpTest() {} 173 virtual ~RtcpTest() {}
173 174
174 static void UpdateCastTransportStatus(transport::CastTransportStatus status) { 175 static void UpdateCastTransportStatus(transport::CastTransportStatus status) {
175 EXPECT_EQ(status, transport::TRANSPORT_INITIALIZED); 176 bool result = (status == transport::TRANSPORT_AUDIO_INITIALIZED ||
177 status == transport::TRANSPORT_VIDEO_INITIALIZED);
178 EXPECT_TRUE(result);
176 } 179 }
177 180
178 void RunTasks(int during_ms) { 181 void RunTasks(int during_ms) {
179 for (int i = 0; i < during_ms; ++i) { 182 for (int i = 0; i < during_ms; ++i) {
180 // Call process the timers every 1 ms. 183 // Call process the timers every 1 ms.
181 testing_clock_->Advance(base::TimeDelta::FromMilliseconds(1)); 184 testing_clock_->Advance(base::TimeDelta::FromMilliseconds(1));
182 task_runner_->RunTasks(); 185 task_runner_->RunTasks();
183 } 186 }
184 } 187 }
185 188
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 rtcp_peer.OnReceivedLipSyncInfo(rtp_timestamp, ntp_seconds, ntp_fractions); 626 rtcp_peer.OnReceivedLipSyncInfo(rtp_timestamp, ntp_seconds, ntp_fractions);
624 rtp_timestamp = 64000; 627 rtp_timestamp = 64000;
625 EXPECT_TRUE(rtcp_peer.RtpTimestampInSenderTime( 628 EXPECT_TRUE(rtcp_peer.RtpTimestampInSenderTime(
626 frequency, rtp_timestamp, &rtp_timestamp_in_ticks)); 629 frequency, rtp_timestamp, &rtp_timestamp_in_ticks));
627 EXPECT_EQ(input_time + base::TimeDelta::FromMilliseconds(4000), 630 EXPECT_EQ(input_time + base::TimeDelta::FromMilliseconds(4000),
628 rtp_timestamp_in_ticks); 631 rtp_timestamp_in_ticks);
629 } 632 }
630 633
631 } // namespace cast 634 } // namespace cast
632 } // namespace media 635 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/audio_sender/audio_sender_unittest.cc ('k') | media/cast/test/end2end_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698