Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: webrtc/modules/audio_device/test/audio_device_test_api.cc

Issue 1593713013: Roll chromium_revision 7a4fb8d..f527e86 (370025:370073) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fix/disable Win Clang warnings Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 #ifdef _WIN32 908 #ifdef _WIN32
909 // use kDefaultCommunicationDevice and modify/retrieve the volume 909 // use kDefaultCommunicationDevice and modify/retrieve the volume
910 EXPECT_TRUE(audio_device_->SetPlayoutDevice( 910 EXPECT_TRUE(audio_device_->SetPlayoutDevice(
911 AudioDeviceModule::kDefaultCommunicationDevice) == 0); 911 AudioDeviceModule::kDefaultCommunicationDevice) == 0);
912 EXPECT_EQ(0, audio_device_->SpeakerVolumeIsAvailable(&available)); 912 EXPECT_EQ(0, audio_device_->SpeakerVolumeIsAvailable(&available));
913 if (available) { 913 if (available) {
914 EXPECT_EQ(0, audio_device_->InitSpeaker()); 914 EXPECT_EQ(0, audio_device_->InitSpeaker());
915 EXPECT_EQ(0, audio_device_->MaxSpeakerVolume(&maxVolume)); 915 EXPECT_EQ(0, audio_device_->MaxSpeakerVolume(&maxVolume));
916 EXPECT_EQ(0, audio_device_->MinSpeakerVolume(&minVolume)); 916 EXPECT_EQ(0, audio_device_->MinSpeakerVolume(&minVolume));
917 EXPECT_EQ(0, audio_device_->SpeakerVolumeStepSize(&stepSize)); 917 EXPECT_EQ(0, audio_device_->SpeakerVolumeStepSize(&stepSize));
918 for (vol = minVolume; vol < (int)maxVolume; vol += 20*stepSize) { 918 for (vol = minVolume; vol < (unsigned int)maxVolume; vol += 20*stepSize) {
919 EXPECT_EQ(0, audio_device_->SetSpeakerVolume(vol)); 919 EXPECT_EQ(0, audio_device_->SetSpeakerVolume(vol));
920 EXPECT_EQ(0, audio_device_->SpeakerVolume(&volume)); 920 EXPECT_EQ(0, audio_device_->SpeakerVolume(&volume));
921 CheckVolume(volume, vol); 921 CheckVolume(volume, vol);
922 } 922 }
923 } 923 }
924 #endif 924 #endif
925 925
926 // use kDefaultDevice and modify/retrieve the volume 926 // use kDefaultDevice and modify/retrieve the volume
927 EXPECT_EQ(0, audio_device_->SetPlayoutDevice(MACRO_DEFAULT_DEVICE)); 927 EXPECT_EQ(0, audio_device_->SetPlayoutDevice(MACRO_DEFAULT_DEVICE));
928 EXPECT_EQ(0, audio_device_->SpeakerVolumeIsAvailable(&available)); 928 EXPECT_EQ(0, audio_device_->SpeakerVolumeIsAvailable(&available));
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 // initialize kDefaultCommunicationDevice and modify/retrieve the volume 1060 // initialize kDefaultCommunicationDevice and modify/retrieve the volume
1061 EXPECT_TRUE(audio_device_->SetRecordingDevice( 1061 EXPECT_TRUE(audio_device_->SetRecordingDevice(
1062 AudioDeviceModule::kDefaultCommunicationDevice) == 0); 1062 AudioDeviceModule::kDefaultCommunicationDevice) == 0);
1063 EXPECT_EQ(0, audio_device_->MicrophoneVolumeIsAvailable(&available)); 1063 EXPECT_EQ(0, audio_device_->MicrophoneVolumeIsAvailable(&available));
1064 if (available) 1064 if (available)
1065 { 1065 {
1066 EXPECT_EQ(0, audio_device_->InitMicrophone()); 1066 EXPECT_EQ(0, audio_device_->InitMicrophone());
1067 EXPECT_EQ(0, audio_device_->MaxMicrophoneVolume(&maxVolume)); 1067 EXPECT_EQ(0, audio_device_->MaxMicrophoneVolume(&maxVolume));
1068 EXPECT_EQ(0, audio_device_->MinMicrophoneVolume(&minVolume)); 1068 EXPECT_EQ(0, audio_device_->MinMicrophoneVolume(&minVolume));
1069 EXPECT_EQ(0, audio_device_->MicrophoneVolumeStepSize(&stepSize)); 1069 EXPECT_EQ(0, audio_device_->MicrophoneVolumeStepSize(&stepSize));
1070 for (vol = minVolume; vol < (int)maxVolume; vol += 10*stepSize) 1070 for (vol = minVolume; vol < (unsigned int)maxVolume; vol += 10*stepSize)
1071 { 1071 {
1072 EXPECT_EQ(0, audio_device_->SetMicrophoneVolume(vol)); 1072 EXPECT_EQ(0, audio_device_->SetMicrophoneVolume(vol));
1073 EXPECT_EQ(0, audio_device_->MicrophoneVolume(&volume)); 1073 EXPECT_EQ(0, audio_device_->MicrophoneVolume(&volume));
1074 CheckVolume(volume, vol); 1074 CheckVolume(volume, vol);
1075 } 1075 }
1076 } 1076 }
1077 #endif 1077 #endif
1078 1078
1079 // reinitialize kDefaultDevice and modify/retrieve the volume 1079 // reinitialize kDefaultDevice and modify/retrieve the volume
1080 EXPECT_EQ(0, audio_device_->SetRecordingDevice(MACRO_DEFAULT_DEVICE)); 1080 EXPECT_EQ(0, audio_device_->SetRecordingDevice(MACRO_DEFAULT_DEVICE));
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
1804 // TODO(kjellander): Fix so these tests pass on Mac. 1804 // TODO(kjellander): Fix so these tests pass on Mac.
1805 #if !defined(WEBRTC_MAC) 1805 #if !defined(WEBRTC_MAC)
1806 EXPECT_EQ(0, audio_device_->InitPlayout()); 1806 EXPECT_EQ(0, audio_device_->InitPlayout());
1807 EXPECT_EQ(0, audio_device_->StartPlayout()); 1807 EXPECT_EQ(0, audio_device_->StartPlayout());
1808 #endif 1808 #endif
1809 1809
1810 EXPECT_EQ(-1, audio_device_->GetLoudspeakerStatus(&loudspeakerOn)); 1810 EXPECT_EQ(-1, audio_device_->GetLoudspeakerStatus(&loudspeakerOn));
1811 #endif 1811 #endif
1812 EXPECT_EQ(0, audio_device_->StopPlayout()); 1812 EXPECT_EQ(0, audio_device_->StopPlayout());
1813 } 1813 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698