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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 const int default_volume = GetSpeakerVolume(); | 813 const int default_volume = GetSpeakerVolume(); |
814 const int max_volume = GetMaxSpeakerVolume(); | 814 const int max_volume = GetMaxSpeakerVolume(); |
815 EXPECT_EQ(0, audio_device()->SetSpeakerVolume(max_volume)); | 815 EXPECT_EQ(0, audio_device()->SetSpeakerVolume(max_volume)); |
816 int new_volume = GetSpeakerVolume(); | 816 int new_volume = GetSpeakerVolume(); |
817 EXPECT_EQ(new_volume, max_volume); | 817 EXPECT_EQ(new_volume, max_volume); |
818 EXPECT_EQ(0, audio_device()->SetSpeakerVolume(default_volume)); | 818 EXPECT_EQ(0, audio_device()->SetSpeakerVolume(default_volume)); |
819 } | 819 } |
820 | 820 |
821 // Tests that playout can be initiated, started and stopped. No audio callback | 821 // Tests that playout can be initiated, started and stopped. No audio callback |
822 // is registered in this test. | 822 // is registered in this test. |
823 // TODO(henrika): figure out why this test can fail on Nexus 9. | |
824 // See https://code.google.com/p/webrtc/issues/detail?id=4682 for details. | |
825 TEST_F(AudioDeviceTest, StartStopPlayout) { | 823 TEST_F(AudioDeviceTest, StartStopPlayout) { |
826 if (DisableTestForThisDevice("Nexus 9")) { | |
827 PRINT("Test is disabled for Nexus 9!\n"); | |
828 return; | |
829 } | |
830 StartPlayout(); | 824 StartPlayout(); |
831 StopPlayout(); | 825 StopPlayout(); |
832 StartPlayout(); | 826 StartPlayout(); |
833 StopPlayout(); | 827 StopPlayout(); |
834 } | 828 } |
835 | 829 |
836 // Verify that calling StopPlayout() will leave us in an uninitialized state | 830 // Verify that calling StopPlayout() will leave us in an uninitialized state |
837 // which will require a new call to InitPlayout(). This test does not call | 831 // which will require a new call to InitPlayout(). This test does not call |
838 // StartPlayout() while being uninitialized since doing so will hit a DCHECK. | 832 // StartPlayout() while being uninitialized since doing so will hit a DCHECK. |
839 TEST_F(AudioDeviceTest, StopPlayoutRequiresInitToRestart) { | 833 TEST_F(AudioDeviceTest, StopPlayoutRequiresInitToRestart) { |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 1000 * kMeasureLatencyTimeInSec)); | 992 1000 * kMeasureLatencyTimeInSec)); |
999 StopPlayout(); | 993 StopPlayout(); |
1000 StopRecording(); | 994 StopRecording(); |
1001 // Verify that the correct number of transmitted impulses are detected. | 995 // Verify that the correct number of transmitted impulses are detected. |
1002 EXPECT_EQ(latency_audio_stream->num_latency_values(), | 996 EXPECT_EQ(latency_audio_stream->num_latency_values(), |
1003 kImpulseFrequencyInHz * kMeasureLatencyTimeInSec - 1); | 997 kImpulseFrequencyInHz * kMeasureLatencyTimeInSec - 1); |
1004 latency_audio_stream->PrintResults(); | 998 latency_audio_stream->PrintResults(); |
1005 } | 999 } |
1006 | 1000 |
1007 } // namespace webrtc | 1001 } // namespace webrtc |
OLD | NEW |