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

Side by Side Diff: webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus_unittest.cc

Issue 2731583003: Fixing a unittest to allow new Opus version. (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 267
268 TEST(AudioEncoderOpusTest, SetReceiverFrameLengthRange) { 268 TEST(AudioEncoderOpusTest, SetReceiverFrameLengthRange) {
269 auto states = CreateCodec(2); 269 auto states = CreateCodec(2);
270 // Before calling to |SetReceiverFrameLengthRange|, 270 // Before calling to |SetReceiverFrameLengthRange|,
271 // |supported_frame_lengths_ms| should contain only the frame length being 271 // |supported_frame_lengths_ms| should contain only the frame length being
272 // used. 272 // used.
273 using ::testing::ElementsAre; 273 using ::testing::ElementsAre;
274 EXPECT_THAT(states.encoder->supported_frame_lengths_ms(), 274 EXPECT_THAT(states.encoder->supported_frame_lengths_ms(),
275 ElementsAre(states.encoder->next_frame_length_ms())); 275 ElementsAre(states.encoder->next_frame_length_ms()));
276 states.encoder->SetReceiverFrameLengthRange(0, 12345); 276 states.encoder->SetReceiverFrameLengthRange(0, 12345);
277 EXPECT_THAT(states.encoder->supported_frame_lengths_ms(),
278 ElementsAre(20, 60));
279 states.encoder->SetReceiverFrameLengthRange(21, 60); 277 states.encoder->SetReceiverFrameLengthRange(21, 60);
280 EXPECT_THAT(states.encoder->supported_frame_lengths_ms(), ElementsAre(60)); 278 EXPECT_THAT(states.encoder->supported_frame_lengths_ms(), ElementsAre(60));
281 states.encoder->SetReceiverFrameLengthRange(20, 59); 279 states.encoder->SetReceiverFrameLengthRange(20, 59);
282 EXPECT_THAT(states.encoder->supported_frame_lengths_ms(), ElementsAre(20)); 280 EXPECT_THAT(states.encoder->supported_frame_lengths_ms(), ElementsAre(20));
283 } 281 }
284 282
285 TEST(AudioEncoderOpusTest, 283 TEST(AudioEncoderOpusTest,
286 InvokeAudioNetworkAdaptorOnReceivedUplinkPacketLossFraction) { 284 InvokeAudioNetworkAdaptorOnReceivedUplinkPacketLossFraction) {
287 auto states = CreateCodec(2); 285 auto states = CreateCodec(2);
288 states.encoder->EnableAudioNetworkAdaptor("", nullptr, nullptr); 286 states.encoder->EnableAudioNetworkAdaptor("", nullptr, nullptr);
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 537
540 // Should encode now. 538 // Should encode now.
541 states.encoder->Encode(rtp_timestamp, audio_frames->GetNextBlock(), 539 states.encoder->Encode(rtp_timestamp, audio_frames->GetNextBlock(),
542 &encoded); 540 &encoded);
543 EXPECT_GT(encoded.size(), 0u); 541 EXPECT_GT(encoded.size(), 0u);
544 encoded.Clear(); 542 encoded.Clear();
545 } 543 }
546 } 544 }
547 545
548 } // namespace webrtc 546 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698