Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 280 } | 280 } |
| 281 } | 281 } |
| 282 | 282 |
| 283 TEST(AudioMixer, ParticipantNumberOfChannels) { | 283 TEST(AudioMixer, ParticipantNumberOfChannels) { |
| 284 const std::unique_ptr<AudioMixer> mixer(AudioMixer::Create(kId)); | 284 const std::unique_ptr<AudioMixer> mixer(AudioMixer::Create(kId)); |
| 285 | 285 |
| 286 MockMixerAudioSource participant; | 286 MockMixerAudioSource participant; |
| 287 ResetFrame(participant.fake_frame()); | 287 ResetFrame(participant.fake_frame()); |
| 288 | 288 |
| 289 EXPECT_EQ(0, mixer->SetMixabilityStatus(&participant, true)); | 289 EXPECT_EQ(0, mixer->SetMixabilityStatus(&participant, true)); |
| 290 for (size_t number_of_channels : {1, 2}) { | 290 for (int number_of_channels : {1, 2}) { |
| 291 EXPECT_CALL(participant, GetAudioFrameWithMuted(_, kDefaultSampleRateHz)) | 291 EXPECT_CALL(participant, GetAudioFrameWithMuted(_, kDefaultSampleRateHz)) |
| 292 .Times(Exactly(1)); | 292 .Times(Exactly(1)); |
| 293 mixer->Mix(kDefaultSampleRateHz, number_of_channels, &frame_for_mixing); | 293 mixer->Mix(kDefaultSampleRateHz, number_of_channels, &frame_for_mixing); |
| 294 EXPECT_EQ(number_of_channels, frame_for_mixing.num_channels_); | 294 EXPECT_EQ(static_cast<size_t>(number_of_channels), |
|
ossu
2016/09/05 12:02:54
I believe you should be able to use one of int or
| |
| 295 frame_for_mixing.num_channels_); | |
| 295 } | 296 } |
| 296 } | 297 } |
| 297 | 298 |
| 298 // Test that the volume is reported as zero when the mixer input | 299 // Test that the volume is reported as zero when the mixer input |
| 299 // comprises only zero values. | 300 // comprises only zero values. |
| 300 TEST(AudioMixer, LevelIsZeroWhenMixingZeroes) { | 301 TEST(AudioMixer, LevelIsZeroWhenMixingZeroes) { |
| 301 const std::unique_ptr<AudioMixer> mixer(AudioMixer::Create(kId)); | 302 const std::unique_ptr<AudioMixer> mixer(AudioMixer::Create(kId)); |
| 302 | 303 |
| 303 MockMixerAudioSource participant; | 304 MockMixerAudioSource participant; |
| 304 ResetFrame(participant.fake_frame()); | 305 ResetFrame(participant.fake_frame()); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 499 kAudioSources, MixerAudioSource::AudioFrameInfo::kNormal); | 500 kAudioSources, MixerAudioSource::AudioFrameInfo::kNormal); |
| 500 frame_info[0] = MixerAudioSource::AudioFrameInfo::kMuted; | 501 frame_info[0] = MixerAudioSource::AudioFrameInfo::kMuted; |
| 501 std::fill(frames[0].data_, frames[0].data_ + kDefaultSampleRateHz / 100, | 502 std::fill(frames[0].data_, frames[0].data_ + kDefaultSampleRateHz / 100, |
| 502 std::numeric_limits<int16_t>::max()); | 503 std::numeric_limits<int16_t>::max()); |
| 503 std::vector<bool> expected_status(kAudioSources, true); | 504 std::vector<bool> expected_status(kAudioSources, true); |
| 504 expected_status[0] = false; | 505 expected_status[0] = false; |
| 505 | 506 |
| 506 MixAndCompare(frames, frame_info, expected_status); | 507 MixAndCompare(frames, frame_info, expected_status); |
| 507 } | 508 } |
| 508 } // namespace webrtc | 509 } // namespace webrtc |
| OLD | NEW |