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

Unified Diff: talk/media/webrtc/webrtcvoiceengine_unittest.cc

Issue 1325023005: Remove Channel::SetRingbackTone() and Channel::PlayRingbackTone(), and the code beneath it (within … (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « talk/media/webrtc/webrtcvoiceengine.cc ('k') | talk/session/media/channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/media/webrtc/webrtcvoiceengine_unittest.cc
diff --git a/talk/media/webrtc/webrtcvoiceengine_unittest.cc b/talk/media/webrtc/webrtcvoiceengine_unittest.cc
index fc373db916a361b9b8ffa19938f2e5a2ef0e9291..d7e85bcd4af6721ac359855e24886d0ee0d0714d 100644
--- a/talk/media/webrtc/webrtcvoiceengine_unittest.cc
+++ b/talk/media/webrtc/webrtcvoiceengine_unittest.cc
@@ -58,7 +58,6 @@ static const cricket::AudioCodec* const kAudioCodecs[] = {
&kPcmuCodec, &kIsacCodec, &kOpusCodec, &kG722CodecVoE, &kRedCodec,
&kCn8000Codec, &kCn16000Codec, &kTelephoneEventCodec,
};
-const char kRingbackTone[] = "RIFF____WAVE____ABCD1234";
static uint32 kSsrc1 = 0x99;
static uint32 kSsrc2 = 0x98;
@@ -2559,62 +2558,6 @@ TEST_F(WebRtcVoiceEngineTestFake, InsertDtmfOnSendStreamAsCallee) {
TestInsertDtmf(kSsrc1, false);
}
-// Test that we can play a ringback tone properly in a single-stream call.
-TEST_F(WebRtcVoiceEngineTestFake, PlayRingback) {
- EXPECT_TRUE(SetupEngine());
- int channel_num = voe_.GetLastChannel();
- EXPECT_EQ(0, voe_.IsPlayingFileLocally(channel_num));
- // Check we fail if no ringback tone specified.
- EXPECT_FALSE(channel_->PlayRingbackTone(0, true, true));
- EXPECT_EQ(0, voe_.IsPlayingFileLocally(channel_num));
- // Check we can set and play a ringback tone.
- EXPECT_TRUE(channel_->SetRingbackTone(
- kRingbackTone, static_cast<int>(strlen(kRingbackTone))));
- EXPECT_TRUE(channel_->PlayRingbackTone(0, true, true));
- EXPECT_EQ(1, voe_.IsPlayingFileLocally(channel_num));
- // Check we can stop the tone manually.
- EXPECT_TRUE(channel_->PlayRingbackTone(0, false, false));
- EXPECT_EQ(0, voe_.IsPlayingFileLocally(channel_num));
- // Check we stop the tone if a packet arrives.
- EXPECT_TRUE(channel_->PlayRingbackTone(0, true, true));
- EXPECT_EQ(1, voe_.IsPlayingFileLocally(channel_num));
- DeliverPacket(kPcmuFrame, sizeof(kPcmuFrame));
- EXPECT_EQ(0, voe_.IsPlayingFileLocally(channel_num));
-}
-
-// Test that we can play a ringback tone properly in a multi-stream call.
-TEST_F(WebRtcVoiceEngineTestFake, PlayRingbackWithMultipleStreams) {
- EXPECT_TRUE(SetupEngine());
- EXPECT_TRUE(channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(1)));
- EXPECT_TRUE(channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(2)));
- int channel_num = voe_.GetLastChannel();
- EXPECT_EQ(0, voe_.IsPlayingFileLocally(channel_num));
- // Check we fail if no ringback tone specified.
- EXPECT_FALSE(channel_->PlayRingbackTone(2, true, true));
- EXPECT_EQ(0, voe_.IsPlayingFileLocally(channel_num));
- // Check we can set and play a ringback tone on the correct ssrc.
- EXPECT_TRUE(channel_->SetRingbackTone(
- kRingbackTone, static_cast<int>(strlen(kRingbackTone))));
- EXPECT_FALSE(channel_->PlayRingbackTone(77, true, true));
- EXPECT_TRUE(channel_->PlayRingbackTone(2, true, true));
- EXPECT_EQ(1, voe_.IsPlayingFileLocally(channel_num));
- // Check we can stop the tone manually.
- EXPECT_TRUE(channel_->PlayRingbackTone(2, false, false));
- EXPECT_EQ(0, voe_.IsPlayingFileLocally(channel_num));
- // Check we stop the tone if a packet arrives, but only with the right SSRC.
- EXPECT_TRUE(channel_->PlayRingbackTone(2, true, true));
- EXPECT_EQ(1, voe_.IsPlayingFileLocally(channel_num));
- // Send a packet with SSRC 1; the tone should not stop.
- DeliverPacket(kPcmuFrame, sizeof(kPcmuFrame));
- EXPECT_EQ(1, voe_.IsPlayingFileLocally(channel_num));
- // Send a packet with SSRC 2; the tone should stop.
- char packet[sizeof(kPcmuFrame)];
- memcpy(packet, kPcmuFrame, sizeof(kPcmuFrame));
- rtc::SetBE32(packet + 8, 2);
- DeliverPacket(packet, sizeof(packet));
- EXPECT_EQ(0, voe_.IsPlayingFileLocally(channel_num));
-}
-
TEST_F(WebRtcVoiceEngineTestFake, MediaEngineCallbackOnError) {
rtc::scoped_ptr<ChannelErrorListener> listener;
cricket::WebRtcVoiceMediaChannel* media_channel;
« no previous file with comments | « talk/media/webrtc/webrtcvoiceengine.cc ('k') | talk/session/media/channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698