| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 EXPECT_EQ(0, audio_device_->MicrophoneVolumeIsAvailable(&available)); | 1033 EXPECT_EQ(0, audio_device_->MicrophoneVolumeIsAvailable(&available)); |
| 1034 EXPECT_FALSE(audio_device_->MicrophoneIsInitialized()); | 1034 EXPECT_FALSE(audio_device_->MicrophoneIsInitialized()); |
| 1035 } | 1035 } |
| 1036 } | 1036 } |
| 1037 | 1037 |
| 1038 // Tests the methods: | 1038 // Tests the methods: |
| 1039 // SetMicrophoneVolume | 1039 // SetMicrophoneVolume |
| 1040 // MicrophoneVolume | 1040 // MicrophoneVolume |
| 1041 // MaxMicrophoneVolume | 1041 // MaxMicrophoneVolume |
| 1042 // MinMicrophoneVolume | 1042 // MinMicrophoneVolume |
| 1043 // NOTE: Disabled on mac due to issue 257. | 1043 |
| 1044 #ifndef WEBRTC_MAC | 1044 // Disabled on Mac and Linux, |
| 1045 TEST_F(AudioDeviceAPITest, MicrophoneVolumeTests) { | 1045 // see https://bugs.chromium.org/p/webrtc/issues/detail?id=5414 |
| 1046 #if defined(WEBRTC_MAC) || defined(WEBRTC_LINUX) |
| 1047 #define MAYBE_MicrophoneVolumeTests DISABLED_MicrophoneVolumeTests |
| 1048 #else |
| 1049 #define MAYBE_MicrophoneVolumeTests MicrophoneVolumeTests |
| 1050 #endif |
| 1051 TEST_F(AudioDeviceAPITest, MAYBE_MicrophoneVolumeTests) { |
| 1046 uint32_t vol(0); | 1052 uint32_t vol(0); |
| 1047 uint32_t volume(0); | 1053 uint32_t volume(0); |
| 1048 uint32_t maxVolume(0); | 1054 uint32_t maxVolume(0); |
| 1049 uint32_t minVolume(0); | 1055 uint32_t minVolume(0); |
| 1050 uint16_t stepSize(0); | 1056 uint16_t stepSize(0); |
| 1051 bool available; | 1057 bool available; |
| 1052 CheckInitialRecordingStates(); | 1058 CheckInitialRecordingStates(); |
| 1053 | 1059 |
| 1054 // fail tests | 1060 // fail tests |
| 1055 EXPECT_EQ(-1, audio_device_->SetMicrophoneVolume(0)); | 1061 EXPECT_EQ(-1, audio_device_->SetMicrophoneVolume(0)); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 | 1134 |
| 1129 // restore reasonable level | 1135 // restore reasonable level |
| 1130 EXPECT_EQ(0, audio_device_->SetRecordingDevice(MACRO_DEFAULT_DEVICE)); | 1136 EXPECT_EQ(0, audio_device_->SetRecordingDevice(MACRO_DEFAULT_DEVICE)); |
| 1131 EXPECT_EQ(0, audio_device_->MicrophoneVolumeIsAvailable(&available)); | 1137 EXPECT_EQ(0, audio_device_->MicrophoneVolumeIsAvailable(&available)); |
| 1132 if (available) { | 1138 if (available) { |
| 1133 EXPECT_EQ(0, audio_device_->InitMicrophone()); | 1139 EXPECT_EQ(0, audio_device_->InitMicrophone()); |
| 1134 EXPECT_EQ(0, audio_device_->MaxMicrophoneVolume(&maxVolume)); | 1140 EXPECT_EQ(0, audio_device_->MaxMicrophoneVolume(&maxVolume)); |
| 1135 EXPECT_EQ(0, audio_device_->SetMicrophoneVolume(maxVolume/10)); | 1141 EXPECT_EQ(0, audio_device_->SetMicrophoneVolume(maxVolume/10)); |
| 1136 } | 1142 } |
| 1137 } | 1143 } |
| 1138 #endif // !WEBRTC_MAC | |
| 1139 | 1144 |
| 1140 TEST_F(AudioDeviceAPITest, SpeakerMuteIsAvailable) { | 1145 TEST_F(AudioDeviceAPITest, SpeakerMuteIsAvailable) { |
| 1141 bool available; | 1146 bool available; |
| 1142 CheckInitialPlayoutStates(); | 1147 CheckInitialPlayoutStates(); |
| 1143 #ifdef _WIN32 | 1148 #ifdef _WIN32 |
| 1144 // check the kDefaultCommunicationDevice | 1149 // check the kDefaultCommunicationDevice |
| 1145 EXPECT_TRUE(audio_device_->SetPlayoutDevice( | 1150 EXPECT_TRUE(audio_device_->SetPlayoutDevice( |
| 1146 AudioDeviceModule::kDefaultCommunicationDevice) == 0); | 1151 AudioDeviceModule::kDefaultCommunicationDevice) == 0); |
| 1147 EXPECT_EQ(0, audio_device_->SpeakerMuteIsAvailable(&available)); | 1152 EXPECT_EQ(0, audio_device_->SpeakerMuteIsAvailable(&available)); |
| 1148 // check for availability should not lead to initialization | 1153 // check for availability should not lead to initialization |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1822 // TODO(kjellander): Fix so these tests pass on Mac. | 1827 // TODO(kjellander): Fix so these tests pass on Mac. |
| 1823 #if !defined(WEBRTC_MAC) | 1828 #if !defined(WEBRTC_MAC) |
| 1824 EXPECT_EQ(0, audio_device_->InitPlayout()); | 1829 EXPECT_EQ(0, audio_device_->InitPlayout()); |
| 1825 EXPECT_EQ(0, audio_device_->StartPlayout()); | 1830 EXPECT_EQ(0, audio_device_->StartPlayout()); |
| 1826 #endif | 1831 #endif |
| 1827 | 1832 |
| 1828 EXPECT_EQ(-1, audio_device_->GetLoudspeakerStatus(&loudspeakerOn)); | 1833 EXPECT_EQ(-1, audio_device_->GetLoudspeakerStatus(&loudspeakerOn)); |
| 1829 #endif | 1834 #endif |
| 1830 EXPECT_EQ(0, audio_device_->StopPlayout()); | 1835 EXPECT_EQ(0, audio_device_->StopPlayout()); |
| 1831 } | 1836 } |
| OLD | NEW |