Index: webrtc/media/engine/webrtcvoiceengine_unittest.cc |
diff --git a/webrtc/media/engine/webrtcvoiceengine_unittest.cc b/webrtc/media/engine/webrtcvoiceengine_unittest.cc |
index 1b7b5697aa574081764bd5516bc5748728f5d0be..3bab92ddc65efe6cfcb88886e2b091ec2c2fdd74 100644 |
--- a/webrtc/media/engine/webrtcvoiceengine_unittest.cc |
+++ b/webrtc/media/engine/webrtcvoiceengine_unittest.cc |
@@ -221,7 +221,8 @@ class WebRtcVoiceEngineTestFake : public testing::Test { |
EXPECT_TRUE(channel_->SetAudioSend(ssrc, enable, options, source)); |
} |
- void TestInsertDtmf(uint32_t ssrc, bool caller) { |
+ void TestInsertDtmf(uint32_t ssrc, bool caller, |
+ const cricket::AudioCodec& codec) { |
EXPECT_TRUE(SetupChannel()); |
if (caller) { |
// If this is a caller, local description will be applied and add the |
@@ -235,7 +236,7 @@ class WebRtcVoiceEngineTestFake : public testing::Test { |
SetSend(true); |
EXPECT_FALSE(channel_->CanInsertDtmf()); |
EXPECT_FALSE(channel_->InsertDtmf(ssrc, 1, 111)); |
- send_parameters_.codecs.push_back(kTelephoneEventCodec1); |
+ send_parameters_.codecs.push_back(codec); |
SetSendParameters(send_parameters_); |
EXPECT_TRUE(channel_->CanInsertDtmf()); |
@@ -255,7 +256,8 @@ class WebRtcVoiceEngineTestFake : public testing::Test { |
EXPECT_EQ(-1, telephone_event.payload_type); |
EXPECT_TRUE(channel_->InsertDtmf(ssrc, 2, 123)); |
telephone_event = GetSendStream(kSsrc1).GetLatestTelephoneEvent(); |
- EXPECT_EQ(kTelephoneEventCodec1.id, telephone_event.payload_type); |
+ EXPECT_EQ(codec.id, telephone_event.payload_type); |
+ EXPECT_EQ(codec.clockrate, telephone_event.payload_frequency); |
EXPECT_EQ(2, telephone_event.event_code); |
EXPECT_EQ(123, telephone_event.duration_ms); |
} |
@@ -1884,7 +1886,7 @@ TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecsDTMFOnTop) { |
TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecsDTMFPayloadTypeOutOfRange) { |
EXPECT_TRUE(SetupSendStream()); |
cricket::AudioSendParameters parameters; |
- parameters.codecs.push_back(kTelephoneEventCodec1); |
+ parameters.codecs.push_back(kTelephoneEventCodec2); |
parameters.codecs.push_back(kIsacCodec); |
parameters.codecs[0].id = 0; // DTMF |
parameters.codecs[1].id = 96; |
@@ -1952,7 +1954,7 @@ TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecsCNandDTMFAsCallee) { |
// TODO(juberti): cn 32000 |
parameters.codecs.push_back(kCn16000Codec); |
parameters.codecs.push_back(kCn8000Codec); |
- parameters.codecs.push_back(kTelephoneEventCodec1); |
+ parameters.codecs.push_back(kTelephoneEventCodec2); |
parameters.codecs[0].id = 96; |
parameters.codecs[2].id = 97; // wideband CN |
parameters.codecs[4].id = 98; // DTMF |
@@ -2732,22 +2734,22 @@ TEST_F(WebRtcVoiceEngineTestFake, TestNoLeakingWhenAddRecvStreamFail) { |
// Test the InsertDtmf on default send stream as caller. |
TEST_F(WebRtcVoiceEngineTestFake, InsertDtmfOnDefaultSendStreamAsCaller) { |
- TestInsertDtmf(0, true); |
+ TestInsertDtmf(0, true, kTelephoneEventCodec1); |
} |
// Test the InsertDtmf on default send stream as callee |
TEST_F(WebRtcVoiceEngineTestFake, InsertDtmfOnDefaultSendStreamAsCallee) { |
- TestInsertDtmf(0, false); |
+ TestInsertDtmf(0, false, kTelephoneEventCodec2); |
} |
// Test the InsertDtmf on specified send stream as caller. |
TEST_F(WebRtcVoiceEngineTestFake, InsertDtmfOnSendStreamAsCaller) { |
- TestInsertDtmf(kSsrc1, true); |
+ TestInsertDtmf(kSsrc1, true, kTelephoneEventCodec2); |
} |
// Test the InsertDtmf on specified send stream as callee. |
TEST_F(WebRtcVoiceEngineTestFake, InsertDtmfOnSendStreamAsCallee) { |
- TestInsertDtmf(kSsrc1, false); |
+ TestInsertDtmf(kSsrc1, false, kTelephoneEventCodec1); |
} |
TEST_F(WebRtcVoiceEngineTestFake, SetAudioOptions) { |