| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 MockMixerAudioSource() | 54 MockMixerAudioSource() |
| 55 : fake_audio_frame_info_(AudioMixer::Source::AudioFrameInfo::kNormal) { | 55 : fake_audio_frame_info_(AudioMixer::Source::AudioFrameInfo::kNormal) { |
| 56 ON_CALL(*this, GetAudioFrameWithInfo(_, _)) | 56 ON_CALL(*this, GetAudioFrameWithInfo(_, _)) |
| 57 .WillByDefault( | 57 .WillByDefault( |
| 58 Invoke(this, &MockMixerAudioSource::FakeAudioFrameWithInfo)); | 58 Invoke(this, &MockMixerAudioSource::FakeAudioFrameWithInfo)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 MOCK_METHOD2(GetAudioFrameWithInfo, | 61 MOCK_METHOD2(GetAudioFrameWithInfo, |
| 62 AudioFrameInfo(int sample_rate_hz, AudioFrame* audio_frame)); | 62 AudioFrameInfo(int sample_rate_hz, AudioFrame* audio_frame)); |
| 63 | 63 |
| 64 MOCK_METHOD0(Ssrc, int()); | 64 MOCK_CONST_METHOD0(PreferredSampleRate, int()); |
| 65 MOCK_CONST_METHOD0(Ssrc, int()); |
| 65 | 66 |
| 66 AudioFrame* fake_frame() { return &fake_frame_; } | 67 AudioFrame* fake_frame() { return &fake_frame_; } |
| 67 AudioFrameInfo fake_info() { return fake_audio_frame_info_; } | 68 AudioFrameInfo fake_info() { return fake_audio_frame_info_; } |
| 68 void set_fake_info(const AudioFrameInfo audio_frame_info) { | 69 void set_fake_info(const AudioFrameInfo audio_frame_info) { |
| 69 fake_audio_frame_info_ = audio_frame_info; | 70 fake_audio_frame_info_ = audio_frame_info; |
| 70 } | 71 } |
| 71 | 72 |
| 72 private: | 73 private: |
| 73 AudioFrame fake_frame_; | 74 AudioFrame fake_frame_; |
| 74 AudioFrameInfo fake_audio_frame_info_; | 75 AudioFrameInfo fake_audio_frame_info_; |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 kAudioSources, AudioMixer::Source::AudioFrameInfo::kNormal); | 363 kAudioSources, AudioMixer::Source::AudioFrameInfo::kNormal); |
| 363 frame_info[0] = AudioMixer::Source::AudioFrameInfo::kMuted; | 364 frame_info[0] = AudioMixer::Source::AudioFrameInfo::kMuted; |
| 364 std::fill(frames[0].data_, frames[0].data_ + kDefaultSampleRateHz / 100, | 365 std::fill(frames[0].data_, frames[0].data_ + kDefaultSampleRateHz / 100, |
| 365 std::numeric_limits<int16_t>::max()); | 366 std::numeric_limits<int16_t>::max()); |
| 366 std::vector<bool> expected_status(kAudioSources, true); | 367 std::vector<bool> expected_status(kAudioSources, true); |
| 367 expected_status[0] = false; | 368 expected_status[0] = false; |
| 368 | 369 |
| 369 MixAndCompare(frames, frame_info, expected_status); | 370 MixAndCompare(frames, frame_info, expected_status); |
| 370 } | 371 } |
| 371 } // namespace webrtc | 372 } // namespace webrtc |
| OLD | NEW |