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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 // is registered in this test. | 826 // is registered in this test. |
827 TEST_F(AudioDeviceTest, StartStopPlayout) { | 827 TEST_F(AudioDeviceTest, StartStopPlayout) { |
828 StartPlayout(); | 828 StartPlayout(); |
829 StopPlayout(); | 829 StopPlayout(); |
830 StartPlayout(); | 830 StartPlayout(); |
831 StopPlayout(); | 831 StopPlayout(); |
832 } | 832 } |
833 | 833 |
834 // Verify that calling StopPlayout() will leave us in an uninitialized state | 834 // Verify that calling StopPlayout() will leave us in an uninitialized state |
835 // which will require a new call to InitPlayout(). This test does not call | 835 // which will require a new call to InitPlayout(). This test does not call |
836 // StartPlayout() while being uninitialized since doing so will hit a DCHECK. | 836 // StartPlayout() while being uninitialized since doing so will hit a |
| 837 // RTC_DCHECK. |
837 TEST_F(AudioDeviceTest, StopPlayoutRequiresInitToRestart) { | 838 TEST_F(AudioDeviceTest, StopPlayoutRequiresInitToRestart) { |
838 EXPECT_EQ(0, audio_device()->InitPlayout()); | 839 EXPECT_EQ(0, audio_device()->InitPlayout()); |
839 EXPECT_EQ(0, audio_device()->StartPlayout()); | 840 EXPECT_EQ(0, audio_device()->StartPlayout()); |
840 EXPECT_EQ(0, audio_device()->StopPlayout()); | 841 EXPECT_EQ(0, audio_device()->StopPlayout()); |
841 EXPECT_FALSE(audio_device()->PlayoutIsInitialized()); | 842 EXPECT_FALSE(audio_device()->PlayoutIsInitialized()); |
842 } | 843 } |
843 | 844 |
844 // Start playout and verify that the native audio layer starts asking for real | 845 // Start playout and verify that the native audio layer starts asking for real |
845 // audio samples to play out using the NeedMorePlayData callback. | 846 // audio samples to play out using the NeedMorePlayData callback. |
846 TEST_F(AudioDeviceTest, StartPlayoutVerifyCallbacks) { | 847 TEST_F(AudioDeviceTest, StartPlayoutVerifyCallbacks) { |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 StopPlayout(); | 998 StopPlayout(); |
998 StopRecording(); | 999 StopRecording(); |
999 // Verify that the correct number of transmitted impulses are detected. | 1000 // Verify that the correct number of transmitted impulses are detected. |
1000 EXPECT_EQ(latency_audio_stream->num_latency_values(), | 1001 EXPECT_EQ(latency_audio_stream->num_latency_values(), |
1001 static_cast<size_t>( | 1002 static_cast<size_t>( |
1002 kImpulseFrequencyInHz * kMeasureLatencyTimeInSec - 1)); | 1003 kImpulseFrequencyInHz * kMeasureLatencyTimeInSec - 1)); |
1003 latency_audio_stream->PrintResults(); | 1004 latency_audio_stream->PrintResults(); |
1004 } | 1005 } |
1005 | 1006 |
1006 } // namespace webrtc | 1007 } // namespace webrtc |
OLD | NEW |