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

Unified Diff: webrtc/audio/audio_send_stream_unittest.cc

Issue 1491743004: Refactor WVoE DTMF handling #2 (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@wvoe_dtmf
Patch Set: rebase Created 5 years 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 | « webrtc/audio/audio_send_stream.cc ('k') | webrtc/audio_send_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/audio/audio_send_stream_unittest.cc
diff --git a/webrtc/audio/audio_send_stream_unittest.cc b/webrtc/audio/audio_send_stream_unittest.cc
index 8dc6da7a8232ca5a37b90be6665a62e091e6c608..c3620b294c28114a0428e13c0351316b439626df 100644
--- a/webrtc/audio/audio_send_stream_unittest.cc
+++ b/webrtc/audio/audio_send_stream_unittest.cc
@@ -40,6 +40,9 @@ const CallStatistics kCallStats = {
1345, 1678, 1901, 1234, 112, 13456, 17890, 1567, -1890, -1123};
const CodecInst kCodecInst = {-121, "codec_name_send", 48000, -231, -451, -671};
const ReportBlock kReportBlock = {456, 780, 123, 567, 890, 132, 143, 13354};
+const int kTelephoneEventPayloadType = 123;
+const uint8_t kTelephoneEventCode = 45;
+const uint32_t kTelephoneEventDuration = 6789;
struct ConfigHelper {
ConfigHelper() : stream_config_(nullptr) {
@@ -79,6 +82,16 @@ struct ConfigHelper {
AudioSendStream::Config& config() { return stream_config_; }
rtc::scoped_refptr<AudioState> audio_state() { return audio_state_; }
+ void SetupMockForSendTelephoneEvent() {
+ EXPECT_TRUE(channel_proxy_);
+ EXPECT_CALL(*channel_proxy_,
+ SetSendTelephoneEventPayloadType(kTelephoneEventPayloadType))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*channel_proxy_,
+ SendTelephoneEventOutband(kTelephoneEventCode, kTelephoneEventDuration))
+ .WillOnce(Return(true));
+ }
+
void SetupMockForGetStats() {
using testing::DoAll;
using testing::SetArgReferee;
@@ -142,6 +155,14 @@ TEST(AudioSendStreamTest, ConstructDestruct) {
internal::AudioSendStream send_stream(helper.config(), helper.audio_state());
}
+TEST(AudioSendStreamTest, SendTelephoneEvent) {
+ ConfigHelper helper;
+ internal::AudioSendStream send_stream(helper.config(), helper.audio_state());
+ helper.SetupMockForSendTelephoneEvent();
+ EXPECT_TRUE(send_stream.SendTelephoneEvent(kTelephoneEventPayloadType,
+ kTelephoneEventCode, kTelephoneEventDuration));
+}
+
TEST(AudioSendStreamTest, GetStats) {
ConfigHelper helper;
internal::AudioSendStream send_stream(helper.config(), helper.audio_state());
« no previous file with comments | « webrtc/audio/audio_send_stream.cc ('k') | webrtc/audio_send_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698