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 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 if (available) { | 1487 if (available) { |
1488 EXPECT_EQ(0, audio_device_->SetStereoRecording(true)); | 1488 EXPECT_EQ(0, audio_device_->SetStereoRecording(true)); |
1489 EXPECT_EQ(0, audio_device_->StereoRecording(&enabled)); | 1489 EXPECT_EQ(0, audio_device_->StereoRecording(&enabled)); |
1490 EXPECT_TRUE(enabled); | 1490 EXPECT_TRUE(enabled); |
1491 EXPECT_EQ(0, audio_device_->SetStereoRecording(false)); | 1491 EXPECT_EQ(0, audio_device_->SetStereoRecording(false)); |
1492 EXPECT_EQ(0, audio_device_->StereoRecording(&enabled)); | 1492 EXPECT_EQ(0, audio_device_->StereoRecording(&enabled)); |
1493 EXPECT_FALSE(enabled); | 1493 EXPECT_FALSE(enabled); |
1494 } | 1494 } |
1495 } | 1495 } |
1496 | 1496 |
1497 TEST_F(AudioDeviceAPITest, RecordingChannelTests) { | |
1498 // the user in Win Core Audio | |
1499 AudioDeviceModule::ChannelType channelType(AudioDeviceModule::kChannelBoth); | |
1500 CheckInitialRecordingStates(); | |
1501 EXPECT_FALSE(audio_device_->Playing()); | |
1502 | |
1503 // fail tests | |
1504 EXPECT_EQ(0, audio_device_->SetStereoRecording(false)); | |
1505 EXPECT_EQ(-1, audio_device_->SetRecordingChannel( | |
1506 AudioDeviceModule::kChannelBoth)); | |
1507 | |
1508 // initialize kDefaultCommunicationDevice and modify/retrieve stereo support | |
1509 EXPECT_EQ(0, audio_device_->SetRecordingDevice( | |
1510 MACRO_DEFAULT_COMMUNICATION_DEVICE)); | |
1511 bool available; | |
1512 EXPECT_EQ(0, audio_device_->StereoRecordingIsAvailable(&available)); | |
1513 if (available) { | |
1514 EXPECT_EQ(0, audio_device_->SetStereoRecording(true)); | |
1515 EXPECT_EQ(0, audio_device_->SetRecordingChannel( | |
1516 AudioDeviceModule::kChannelBoth)); | |
1517 EXPECT_EQ(0, audio_device_->RecordingChannel(&channelType)); | |
1518 EXPECT_EQ(AudioDeviceModule::kChannelBoth, channelType); | |
1519 EXPECT_EQ(0, audio_device_->SetRecordingChannel( | |
1520 AudioDeviceModule::kChannelLeft)); | |
1521 EXPECT_EQ(0, audio_device_->RecordingChannel(&channelType)); | |
1522 EXPECT_EQ(AudioDeviceModule::kChannelLeft, channelType); | |
1523 EXPECT_EQ(0, audio_device_->SetRecordingChannel( | |
1524 AudioDeviceModule::kChannelRight)); | |
1525 EXPECT_EQ(0, audio_device_->RecordingChannel(&channelType)); | |
1526 EXPECT_EQ(AudioDeviceModule::kChannelRight, channelType); | |
1527 } | |
1528 } | |
1529 | |
1530 TEST_F(AudioDeviceAPITest, PlayoutBufferTests) { | 1497 TEST_F(AudioDeviceAPITest, PlayoutBufferTests) { |
1531 AudioDeviceModule::BufferType bufferType; | 1498 AudioDeviceModule::BufferType bufferType; |
1532 uint16_t sizeMS(0); | 1499 uint16_t sizeMS(0); |
1533 | 1500 |
1534 CheckInitialPlayoutStates(); | 1501 CheckInitialPlayoutStates(); |
1535 EXPECT_EQ(0, audio_device_->PlayoutBuffer(&bufferType, &sizeMS)); | 1502 EXPECT_EQ(0, audio_device_->PlayoutBuffer(&bufferType, &sizeMS)); |
1536 #if defined(_WIN32) || defined(ANDROID) || defined(WEBRTC_IOS) | 1503 #if defined(_WIN32) || defined(ANDROID) || defined(WEBRTC_IOS) |
1537 EXPECT_EQ(AudioDeviceModule::kAdaptiveBufferSize, bufferType); | 1504 EXPECT_EQ(AudioDeviceModule::kAdaptiveBufferSize, bufferType); |
1538 #else | 1505 #else |
1539 EXPECT_EQ(AudioDeviceModule::kFixedBufferSize, bufferType); | 1506 EXPECT_EQ(AudioDeviceModule::kFixedBufferSize, bufferType); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1811 // TODO(kjellander): Fix so these tests pass on Mac. | 1778 // TODO(kjellander): Fix so these tests pass on Mac. |
1812 #if !defined(WEBRTC_MAC) | 1779 #if !defined(WEBRTC_MAC) |
1813 EXPECT_EQ(0, audio_device_->InitPlayout()); | 1780 EXPECT_EQ(0, audio_device_->InitPlayout()); |
1814 EXPECT_EQ(0, audio_device_->StartPlayout()); | 1781 EXPECT_EQ(0, audio_device_->StartPlayout()); |
1815 #endif | 1782 #endif |
1816 | 1783 |
1817 EXPECT_EQ(-1, audio_device_->GetLoudspeakerStatus(&loudspeakerOn)); | 1784 EXPECT_EQ(-1, audio_device_->GetLoudspeakerStatus(&loudspeakerOn)); |
1818 #endif | 1785 #endif |
1819 EXPECT_EQ(0, audio_device_->StopPlayout()); | 1786 EXPECT_EQ(0, audio_device_->StopPlayout()); |
1820 } | 1787 } |
OLD | NEW |