Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 818 std::max(kTestTimeOutInMilliseconds, 1000 * kMeasureLatencyTimeInSec)); | 818 std::max(kTestTimeOutInMilliseconds, 1000 * kMeasureLatencyTimeInSec)); |
| 819 StopPlayout(); | 819 StopPlayout(); |
| 820 StopRecording(); | 820 StopRecording(); |
| 821 // Verify that the correct number of transmitted impulses are detected. | 821 // Verify that the correct number of transmitted impulses are detected. |
| 822 EXPECT_EQ(latency_audio_stream->num_latency_values(), | 822 EXPECT_EQ(latency_audio_stream->num_latency_values(), |
| 823 static_cast<size_t>( | 823 static_cast<size_t>( |
| 824 kImpulseFrequencyInHz * kMeasureLatencyTimeInSec - 1)); | 824 kImpulseFrequencyInHz * kMeasureLatencyTimeInSec - 1)); |
| 825 latency_audio_stream->PrintResults(); | 825 latency_audio_stream->PrintResults(); |
| 826 } | 826 } |
| 827 | 827 |
| 828 // Verifies that the AudioDeviceIOS is_interrupted_ flag is reset correctly afte r an iOS | |
|
henrika_webrtc
2017/05/11 08:00:28
Please use 80 characters per line as in rest of th
| |
| 829 // AVAudioSessionInterruptionTypeEnded notification event. | |
| 830 // When AudioDeviceIOS is interrupted, is_interrupted_ set to true. | |
|
henrika_webrtc
2017/05/11 08:00:28
'is_interrupted is set to true'
| |
| 831 // When the audio is stopped, the RTCAudioSessionDelegate would be removed. | |
| 832 // Then when the iOS AVAudioSessionInterruptionTypeEnded notification is receive d, the event | |
| 833 // is not passed to the delegate as it is no longer in the delegates list. | |
|
henrika_webrtc
2017/05/11 08:00:28
Could you make it more clear that this is the expe
| |
| 828 TEST_F(AudioDeviceTest, testInterruptedAudioSession) { | 834 TEST_F(AudioDeviceTest, testInterruptedAudioSession) { |
| 829 RTCAudioSession *session = [RTCAudioSession sharedInstance]; | 835 RTCAudioSession *session = [RTCAudioSession sharedInstance]; |
| 830 std::unique_ptr<webrtc::AudioDeviceIOS> audio_device; | 836 std::unique_ptr<webrtc::AudioDeviceIOS> audio_device; |
| 831 audio_device.reset(new webrtc::AudioDeviceIOS()); | 837 audio_device.reset(new webrtc::AudioDeviceIOS()); |
| 832 std::unique_ptr<webrtc::AudioDeviceBuffer> audio_buffer; | 838 std::unique_ptr<webrtc::AudioDeviceBuffer> audio_buffer; |
| 833 audio_buffer.reset(new webrtc::AudioDeviceBuffer()); | 839 audio_buffer.reset(new webrtc::AudioDeviceBuffer()); |
| 834 audio_device->AttachAudioBuffer(audio_buffer.get()); | 840 audio_device->AttachAudioBuffer(audio_buffer.get()); |
| 835 audio_device->Init(); | 841 audio_device->Init(); |
| 836 audio_device->InitPlayout(); | 842 audio_device->InitPlayout(); |
| 837 // Force interruption. | 843 // Force interruption. |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 851 // Wait for notification to propagate. | 857 // Wait for notification to propagate. |
| 852 rtc::MessageQueueManager::ProcessAllMessageQueues(); | 858 rtc::MessageQueueManager::ProcessAllMessageQueues(); |
| 853 EXPECT_TRUE(audio_device->is_interrupted_); | 859 EXPECT_TRUE(audio_device->is_interrupted_); |
| 854 | 860 |
| 855 audio_device->Init(); | 861 audio_device->Init(); |
| 856 audio_device->InitPlayout(); | 862 audio_device->InitPlayout(); |
| 857 EXPECT_FALSE(audio_device->is_interrupted_); | 863 EXPECT_FALSE(audio_device->is_interrupted_); |
| 858 } | 864 } |
| 859 | 865 |
| 860 } // namespace webrtc | 866 } // namespace webrtc |
| OLD | NEW |