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

Side by Side Diff: webrtc/modules/audio_device/audio_device_unittest.cc

Issue 2764403003: Skip audio_device_unittest when platform audio isn't used. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 AudioDeviceTest() : event_(false, false) { 199 AudioDeviceTest() : event_(false, false) {
200 #if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) 200 #if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER)
201 rtc::LogMessage::LogToDebug(rtc::LS_INFO); 201 rtc::LogMessage::LogToDebug(rtc::LS_INFO);
202 // Add extra logging fields here if needed for debugging. 202 // Add extra logging fields here if needed for debugging.
203 // rtc::LogMessage::LogTimestamps(); 203 // rtc::LogMessage::LogTimestamps();
204 // rtc::LogMessage::LogThreads(); 204 // rtc::LogMessage::LogThreads();
205 audio_device_ = 205 audio_device_ =
206 AudioDeviceModule::Create(0, AudioDeviceModule::kPlatformDefaultAudio); 206 AudioDeviceModule::Create(0, AudioDeviceModule::kPlatformDefaultAudio);
207 EXPECT_NE(audio_device_.get(), nullptr); 207 EXPECT_NE(audio_device_.get(), nullptr);
208 AudioDeviceModule::AudioLayer audio_layer; 208 AudioDeviceModule::AudioLayer audio_layer;
209 EXPECT_EQ(0, audio_device_->ActiveAudioLayer(&audio_layer)); 209 int got_platform_audio_layer =
210 if (audio_layer == AudioDeviceModule::kLinuxAlsaAudio) { 210 audio_device_->ActiveAudioLayer(&audio_layer);
211 if (got_platform_audio_layer != 0 ||
212 audio_layer == AudioDeviceModule::kLinuxAlsaAudio) {
211 requirements_satisfied_ = false; 213 requirements_satisfied_ = false;
212 } 214 }
213 if (requirements_satisfied_) { 215 if (requirements_satisfied_) {
214 EXPECT_EQ(0, audio_device_->Init()); 216 EXPECT_EQ(0, audio_device_->Init());
215 const int16_t num_playout_devices = audio_device_->PlayoutDevices(); 217 const int16_t num_playout_devices = audio_device_->PlayoutDevices();
216 const int16_t num_record_devices = audio_device_->RecordingDevices(); 218 const int16_t num_record_devices = audio_device_->RecordingDevices();
217 requirements_satisfied_ = 219 requirements_satisfied_ =
218 num_playout_devices > 0 && num_record_devices > 0; 220 num_playout_devices > 0 && num_record_devices > 0;
219 } 221 }
220 #else 222 #else
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 .Times(AtLeast(kNumCallbacks)); 360 .Times(AtLeast(kNumCallbacks));
359 EXPECT_EQ(0, audio_device()->RegisterAudioCallback(&mock)); 361 EXPECT_EQ(0, audio_device()->RegisterAudioCallback(&mock));
360 StartPlayout(); 362 StartPlayout();
361 StartRecording(); 363 StartRecording();
362 event()->Wait(kTestTimeOutInMilliseconds); 364 event()->Wait(kTestTimeOutInMilliseconds);
363 StopRecording(); 365 StopRecording();
364 StopPlayout(); 366 StopPlayout();
365 } 367 }
366 368
367 } // namespace webrtc 369 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698