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

Side by Side Diff: webrtc/media/engine/webrtcvoiceengine_unittest.cc

Issue 2066973002: Add AudioSendStream::SetMuted() method and use it in WVoMC::MuteStream(). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 6 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/media/engine/webrtcvoiceengine.cc ('k') | webrtc/test/mock_voe_channel_proxy.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) 2008 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2008 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 2117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2128 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 2128 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
2129 EXPECT_TRUE(channel_->SetAudioSend(kSsrc1, true, nullptr, nullptr)); 2129 EXPECT_TRUE(channel_->SetAudioSend(kSsrc1, true, nullptr, nullptr));
2130 SetSend(channel_, true); 2130 SetSend(channel_, true);
2131 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending()); 2131 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending());
2132 EXPECT_TRUE(channel_->SetAudioSend(kSsrc1, true, nullptr, &fake_source_)); 2132 EXPECT_TRUE(channel_->SetAudioSend(kSsrc1, true, nullptr, &fake_source_));
2133 EXPECT_TRUE(GetSendStream(kSsrc1).IsSending()); 2133 EXPECT_TRUE(GetSendStream(kSsrc1).IsSending());
2134 EXPECT_TRUE(channel_->SetAudioSend(kSsrc1, true, nullptr, nullptr)); 2134 EXPECT_TRUE(channel_->SetAudioSend(kSsrc1, true, nullptr, nullptr));
2135 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending()); 2135 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending());
2136 } 2136 }
2137 2137
2138 // Test that a channel is muted/unmuted.
2139 TEST_F(WebRtcVoiceEngineTestFake, SendStateMuteUnmute) {
2140 EXPECT_TRUE(SetupSendStream());
2141 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
2142 EXPECT_FALSE(GetSendStream(kSsrc1).muted());
2143 EXPECT_TRUE(channel_->SetAudioSend(kSsrc1, true, nullptr, nullptr));
2144 EXPECT_FALSE(GetSendStream(kSsrc1).muted());
2145 EXPECT_TRUE(channel_->SetAudioSend(kSsrc1, false, nullptr, nullptr));
2146 EXPECT_TRUE(GetSendStream(kSsrc1).muted());
2147 }
2148
2138 // Test that SetSendParameters() does not alter a stream's send state. 2149 // Test that SetSendParameters() does not alter a stream's send state.
2139 TEST_F(WebRtcVoiceEngineTestFake, SendStateWhenStreamsAreRecreated) { 2150 TEST_F(WebRtcVoiceEngineTestFake, SendStateWhenStreamsAreRecreated) {
2140 EXPECT_TRUE(SetupSendStream()); 2151 EXPECT_TRUE(SetupSendStream());
2141 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending()); 2152 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending());
2142 2153
2143 // Turn on sending. 2154 // Turn on sending.
2144 SetSend(channel_, true); 2155 SetSend(channel_, true);
2145 EXPECT_TRUE(GetSendStream(kSsrc1).IsSending()); 2156 EXPECT_TRUE(GetSendStream(kSsrc1).IsSending());
2146 2157
2147 // Changing RTP header extensions will recreate the AudioSendStream. 2158 // Changing RTP header extensions will recreate the AudioSendStream.
(...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after
3515 cricket::WebRtcVoiceEngine engine( 3526 cricket::WebRtcVoiceEngine engine(
3516 nullptr, webrtc::CreateBuiltinAudioDecoderFactory()); 3527 nullptr, webrtc::CreateBuiltinAudioDecoderFactory());
3517 std::unique_ptr<webrtc::Call> call( 3528 std::unique_ptr<webrtc::Call> call(
3518 webrtc::Call::Create(webrtc::Call::Config())); 3529 webrtc::Call::Create(webrtc::Call::Config()));
3519 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(), 3530 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(),
3520 cricket::AudioOptions(), call.get()); 3531 cricket::AudioOptions(), call.get());
3521 cricket::AudioRecvParameters parameters; 3532 cricket::AudioRecvParameters parameters;
3522 parameters.codecs = engine.recv_codecs(); 3533 parameters.codecs = engine.recv_codecs();
3523 EXPECT_TRUE(channel.SetRecvParameters(parameters)); 3534 EXPECT_TRUE(channel.SetRecvParameters(parameters));
3524 } 3535 }
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | webrtc/test/mock_voe_channel_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698