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 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 | 824 |
825 // Tests that playout can be initiated, started and stopped. No audio callback | 825 // Tests that playout can be initiated, started and stopped. No audio callback |
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 // Tests that recording can be initiated, started and stopped. No audio callback |
| 835 // is registered in this test. |
| 836 TEST_F(AudioDeviceTest, StartStopRecording) { |
| 837 StartRecording(); |
| 838 StopRecording(); |
| 839 StartRecording(); |
| 840 StopRecording(); |
| 841 } |
| 842 |
834 // Verify that calling StopPlayout() will leave us in an uninitialized state | 843 // 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 | 844 // which will require a new call to InitPlayout(). This test does not call |
836 // StartPlayout() while being uninitialized since doing so will hit a | 845 // StartPlayout() while being uninitialized since doing so will hit a |
837 // RTC_DCHECK. | 846 // RTC_DCHECK. |
838 TEST_F(AudioDeviceTest, StopPlayoutRequiresInitToRestart) { | 847 TEST_F(AudioDeviceTest, StopPlayoutRequiresInitToRestart) { |
839 EXPECT_EQ(0, audio_device()->InitPlayout()); | 848 EXPECT_EQ(0, audio_device()->InitPlayout()); |
840 EXPECT_EQ(0, audio_device()->StartPlayout()); | 849 EXPECT_EQ(0, audio_device()->StartPlayout()); |
841 EXPECT_EQ(0, audio_device()->StopPlayout()); | 850 EXPECT_EQ(0, audio_device()->StopPlayout()); |
842 EXPECT_FALSE(audio_device()->PlayoutIsInitialized()); | 851 EXPECT_FALSE(audio_device()->PlayoutIsInitialized()); |
843 } | 852 } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 StopPlayout(); | 1007 StopPlayout(); |
999 StopRecording(); | 1008 StopRecording(); |
1000 // Verify that the correct number of transmitted impulses are detected. | 1009 // Verify that the correct number of transmitted impulses are detected. |
1001 EXPECT_EQ(latency_audio_stream->num_latency_values(), | 1010 EXPECT_EQ(latency_audio_stream->num_latency_values(), |
1002 static_cast<size_t>( | 1011 static_cast<size_t>( |
1003 kImpulseFrequencyInHz * kMeasureLatencyTimeInSec - 1)); | 1012 kImpulseFrequencyInHz * kMeasureLatencyTimeInSec - 1)); |
1004 latency_audio_stream->PrintResults(); | 1013 latency_audio_stream->PrintResults(); |
1005 } | 1014 } |
1006 | 1015 |
1007 } // namespace webrtc | 1016 } // namespace webrtc |
OLD | NEW |