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

Side by Side Diff: webrtc/call/rampup_tests.cc

Issue 2794193003: Move SelectMediaType from RampUpTester to BaseTest. (Closed)
Patch Set: Created 3 years, 8 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 | « webrtc/call/rampup_tests.h ('k') | webrtc/test/call_test.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 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 call_config.bitrate_config.min_bitrate_bps = 10000; 82 call_config.bitrate_config.min_bitrate_bps = 10000;
83 return call_config; 83 return call_config;
84 } 84 }
85 85
86 void RampUpTester::OnVideoStreamsCreated( 86 void RampUpTester::OnVideoStreamsCreated(
87 VideoSendStream* send_stream, 87 VideoSendStream* send_stream,
88 const std::vector<VideoReceiveStream*>& receive_streams) { 88 const std::vector<VideoReceiveStream*>& receive_streams) {
89 send_stream_ = send_stream; 89 send_stream_ = send_stream;
90 } 90 }
91 91
92 MediaType RampUpTester::SelectMediaType() {
93 if (num_video_streams_ > 0) {
94 if (num_audio_streams_ > 0) {
95 // Rely on call to set media type from payload type.
96 return MediaType::ANY;
97 } else {
98 return MediaType::VIDEO;
99 }
100 } else {
101 return MediaType::AUDIO;
102 }
103 }
104
105 test::PacketTransport* RampUpTester::CreateSendTransport(Call* sender_call) { 92 test::PacketTransport* RampUpTester::CreateSendTransport(Call* sender_call) {
106 send_transport_ = new test::PacketTransport(sender_call, this, 93 send_transport_ = new test::PacketTransport(sender_call, this,
107 test::PacketTransport::kSender, 94 test::PacketTransport::kSender,
108 SelectMediaType(), 95 SelectMediaType(),
109 forward_transport_config_); 96 forward_transport_config_);
110 return send_transport_; 97 return send_transport_;
111 } 98 }
112 99
113 test::PacketTransport* RampUpTester::CreateReceiveTransport() {
114 return new test::PacketTransport(nullptr, this,
115 test::PacketTransport::kReceiver,
116 SelectMediaType(),
117 FakeNetworkPipe::Config());
118 }
119
120 size_t RampUpTester::GetNumVideoStreams() const { 100 size_t RampUpTester::GetNumVideoStreams() const {
121 return num_video_streams_; 101 return num_video_streams_;
122 } 102 }
123 103
124 size_t RampUpTester::GetNumAudioStreams() const { 104 size_t RampUpTester::GetNumAudioStreams() const {
125 return num_audio_streams_; 105 return num_audio_streams_;
126 } 106 }
127 107
128 size_t RampUpTester::GetNumFlexfecStreams() const { 108 size_t RampUpTester::GetNumFlexfecStreams() const {
129 return num_flexfec_streams_; 109 return num_flexfec_streams_;
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 RunBaseTest(&test); 641 RunBaseTest(&test);
662 } 642 }
663 643
664 TEST_F(RampUpTest, AudioTransportSequenceNumber) { 644 TEST_F(RampUpTest, AudioTransportSequenceNumber) {
665 RampUpTester test(0, 1, 0, 300000, 10000, 645 RampUpTester test(0, 1, 0, 300000, 10000,
666 RtpExtension::kTransportSequenceNumberUri, false, false, 646 RtpExtension::kTransportSequenceNumberUri, false, false,
667 false); 647 false);
668 RunBaseTest(&test); 648 RunBaseTest(&test);
669 } 649 }
670 } // namespace webrtc 650 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/call/rampup_tests.h ('k') | webrtc/test/call_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698