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

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

Issue 1798903002: Relanding https://codereview.webrtc.org/1715883002/ in pieces. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added test case Created 4 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
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | webrtc/voice_engine/channel.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 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after
1654 parameters.codecs[0].id = 98; // DTMF 1654 parameters.codecs[0].id = 98; // DTMF
1655 parameters.codecs[1].id = 96; 1655 parameters.codecs[1].id = 96;
1656 EXPECT_TRUE(channel_->SetSendParameters(parameters)); 1656 EXPECT_TRUE(channel_->SetSendParameters(parameters));
1657 webrtc::CodecInst gcodec; 1657 webrtc::CodecInst gcodec;
1658 EXPECT_EQ(0, voe_.GetSendCodec(channel_num, gcodec)); 1658 EXPECT_EQ(0, voe_.GetSendCodec(channel_num, gcodec));
1659 EXPECT_EQ(96, gcodec.pltype); 1659 EXPECT_EQ(96, gcodec.pltype);
1660 EXPECT_STREQ("ISAC", gcodec.plname); 1660 EXPECT_STREQ("ISAC", gcodec.plname);
1661 EXPECT_TRUE(channel_->CanInsertDtmf()); 1661 EXPECT_TRUE(channel_->CanInsertDtmf());
1662 } 1662 }
1663 1663
1664 // Test that payload type range is limited for telephone-event codec.
1665 TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecsDTMFPayloadTypeOutOfRange) {
1666 EXPECT_TRUE(SetupEngineWithSendStream());
1667 cricket::AudioSendParameters parameters;
1668 parameters.codecs.push_back(kTelephoneEventCodec);
1669 parameters.codecs.push_back(kIsacCodec);
1670 parameters.codecs[0].id = 0; // DTMF
1671 parameters.codecs[1].id = 96;
1672 EXPECT_TRUE(channel_->SetSendParameters(parameters));
1673 EXPECT_TRUE(channel_->CanInsertDtmf());
1674 parameters.codecs[0].id = 128; // DTMF
1675 EXPECT_FALSE(channel_->SetSendParameters(parameters));
1676 EXPECT_FALSE(channel_->CanInsertDtmf());
1677 parameters.codecs[0].id = 127;
1678 EXPECT_TRUE(channel_->SetSendParameters(parameters));
1679 EXPECT_TRUE(channel_->CanInsertDtmf());
1680 parameters.codecs[0].id = -1; // DTMF
1681 EXPECT_FALSE(channel_->SetSendParameters(parameters));
1682 EXPECT_FALSE(channel_->CanInsertDtmf());
1683 }
1684
1664 // Test that we can set send codecs even with CN codec as the first 1685 // Test that we can set send codecs even with CN codec as the first
1665 // one on the list. 1686 // one on the list.
1666 TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecsCNOnTop) { 1687 TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecsCNOnTop) {
1667 EXPECT_TRUE(SetupEngineWithSendStream()); 1688 EXPECT_TRUE(SetupEngineWithSendStream());
1668 int channel_num = voe_.GetLastChannel(); 1689 int channel_num = voe_.GetLastChannel();
1669 cricket::AudioSendParameters parameters; 1690 cricket::AudioSendParameters parameters;
1670 parameters.codecs.push_back(kCn16000Codec); 1691 parameters.codecs.push_back(kCn16000Codec);
1671 parameters.codecs.push_back(kIsacCodec); 1692 parameters.codecs.push_back(kIsacCodec);
1672 parameters.codecs.push_back(kPcmuCodec); 1693 parameters.codecs.push_back(kPcmuCodec);
1673 parameters.codecs[0].id = 98; // wideband CN 1694 parameters.codecs[0].id = 98; // wideband CN
(...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after
3305 cricket::WebRtcVoiceEngine engine; 3326 cricket::WebRtcVoiceEngine engine;
3306 EXPECT_TRUE(engine.Init(rtc::Thread::Current())); 3327 EXPECT_TRUE(engine.Init(rtc::Thread::Current()));
3307 std::unique_ptr<webrtc::Call> call( 3328 std::unique_ptr<webrtc::Call> call(
3308 webrtc::Call::Create(webrtc::Call::Config())); 3329 webrtc::Call::Create(webrtc::Call::Config()));
3309 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(), 3330 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(),
3310 cricket::AudioOptions(), call.get()); 3331 cricket::AudioOptions(), call.get());
3311 cricket::AudioRecvParameters parameters; 3332 cricket::AudioRecvParameters parameters;
3312 parameters.codecs = engine.codecs(); 3333 parameters.codecs = engine.codecs();
3313 EXPECT_TRUE(channel.SetRecvParameters(parameters)); 3334 EXPECT_TRUE(channel.SetRecvParameters(parameters));
3314 } 3335 }
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | webrtc/voice_engine/channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698