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

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

Issue 2699503002: Change minimum DTMF event duration to be 40 milliseconds (Closed)
Patch Set: Change minimum DTMF event duration to be 40 milliseconds Created 3 years, 10 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
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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 if (!caller) { 246 if (!caller) {
247 // If this is callee, there's no active send channel yet. 247 // If this is callee, there's no active send channel yet.
248 EXPECT_FALSE(channel_->InsertDtmf(ssrc, 2, 123)); 248 EXPECT_FALSE(channel_->InsertDtmf(ssrc, 2, 123));
249 EXPECT_TRUE(channel_->AddSendStream( 249 EXPECT_TRUE(channel_->AddSendStream(
250 cricket::StreamParams::CreateLegacy(kSsrc1))); 250 cricket::StreamParams::CreateLegacy(kSsrc1)));
251 } 251 }
252 252
253 // Check we fail if the ssrc is invalid. 253 // Check we fail if the ssrc is invalid.
254 EXPECT_FALSE(channel_->InsertDtmf(-1, 1, 111)); 254 EXPECT_FALSE(channel_->InsertDtmf(-1, 1, 111));
255 255
256 // Check that we fail if we specify a too short duration
Taylor Brandstetter 2017/02/16 18:18:22 nit: Period at end of comment, "duration that's to
257 EXPECT_FALSE(channel_->InsertDtmf(ssrc, 2, 39));
Taylor Brandstetter 2017/02/16 18:18:22 There should also be a test somewhere that "Insert
258
256 // Test send. 259 // Test send.
257 cricket::FakeAudioSendStream::TelephoneEvent telephone_event = 260 cricket::FakeAudioSendStream::TelephoneEvent telephone_event =
258 GetSendStream(kSsrc1).GetLatestTelephoneEvent(); 261 GetSendStream(kSsrc1).GetLatestTelephoneEvent();
259 EXPECT_EQ(-1, telephone_event.payload_type); 262 EXPECT_EQ(-1, telephone_event.payload_type);
260 EXPECT_TRUE(channel_->InsertDtmf(ssrc, 2, 123)); 263 EXPECT_TRUE(channel_->InsertDtmf(ssrc, 2, 123));
261 telephone_event = GetSendStream(kSsrc1).GetLatestTelephoneEvent(); 264 telephone_event = GetSendStream(kSsrc1).GetLatestTelephoneEvent();
262 EXPECT_EQ(codec.id, telephone_event.payload_type); 265 EXPECT_EQ(codec.id, telephone_event.payload_type);
263 EXPECT_EQ(codec.clockrate, telephone_event.payload_frequency); 266 EXPECT_EQ(codec.clockrate, telephone_event.payload_frequency);
264 EXPECT_EQ(2, telephone_event.event_code); 267 EXPECT_EQ(2, telephone_event.event_code);
265 EXPECT_EQ(123, telephone_event.duration_ms); 268 EXPECT_EQ(123, telephone_event.duration_ms);
(...skipping 3478 matching lines...) Expand 10 before | Expand all | Expand 10 after
3744 // Without this cast, the comparison turned unsigned and, thus, failed for -1. 3747 // Without this cast, the comparison turned unsigned and, thus, failed for -1.
3745 const int num_specs = static_cast<int>(specs.size()); 3748 const int num_specs = static_cast<int>(specs.size());
3746 EXPECT_GE(find_codec({"cn", 8000, 1}), num_specs); 3749 EXPECT_GE(find_codec({"cn", 8000, 1}), num_specs);
3747 EXPECT_GE(find_codec({"cn", 16000, 1}), num_specs); 3750 EXPECT_GE(find_codec({"cn", 16000, 1}), num_specs);
3748 EXPECT_EQ(find_codec({"cn", 32000, 1}), -1); 3751 EXPECT_EQ(find_codec({"cn", 32000, 1}), -1);
3749 EXPECT_GE(find_codec({"telephone-event", 8000, 1}), num_specs); 3752 EXPECT_GE(find_codec({"telephone-event", 8000, 1}), num_specs);
3750 EXPECT_GE(find_codec({"telephone-event", 16000, 1}), num_specs); 3753 EXPECT_GE(find_codec({"telephone-event", 16000, 1}), num_specs);
3751 EXPECT_GE(find_codec({"telephone-event", 32000, 1}), num_specs); 3754 EXPECT_GE(find_codec({"telephone-event", 32000, 1}), num_specs);
3752 EXPECT_GE(find_codec({"telephone-event", 48000, 1}), num_specs); 3755 EXPECT_GE(find_codec({"telephone-event", 48000, 1}), num_specs);
3753 } 3756 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698