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 |
11 #include <algorithm> | 11 #include <algorithm> |
12 #include <limits> | 12 #include <limits> |
13 #include <list> | 13 #include <list> |
14 #include <memory> | 14 #include <memory> |
15 #include <numeric> | 15 #include <numeric> |
16 #include <string> | 16 #include <string> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "webrtc/base/arraysize.h" | |
20 #include "webrtc/base/criticalsection.h" | |
21 #include "webrtc/base/format_macros.h" | |
22 #include "webrtc/base/logging.h" | |
23 #include "webrtc/base/scoped_ref_ptr.h" | |
24 #include "webrtc/base/timeutils.h" | |
25 #include "webrtc/modules/audio_device/audio_device_impl.h" | 19 #include "webrtc/modules/audio_device/audio_device_impl.h" |
26 #include "webrtc/modules/audio_device/include/audio_device.h" | 20 #include "webrtc/modules/audio_device/include/audio_device.h" |
27 #include "webrtc/modules/audio_device/include/mock_audio_transport.h" | 21 #include "webrtc/modules/audio_device/include/mock_audio_transport.h" |
28 #include "webrtc/modules/audio_device/ios/audio_device_ios.h" | 22 #include "webrtc/modules/audio_device/ios/audio_device_ios.h" |
| 23 #include "webrtc/rtc_base/arraysize.h" |
| 24 #include "webrtc/rtc_base/criticalsection.h" |
| 25 #include "webrtc/rtc_base/format_macros.h" |
| 26 #include "webrtc/rtc_base/logging.h" |
| 27 #include "webrtc/rtc_base/scoped_ref_ptr.h" |
| 28 #include "webrtc/rtc_base/timeutils.h" |
29 #include "webrtc/system_wrappers/include/event_wrapper.h" | 29 #include "webrtc/system_wrappers/include/event_wrapper.h" |
30 #include "webrtc/test/gmock.h" | 30 #include "webrtc/test/gmock.h" |
31 #include "webrtc/test/gtest.h" | 31 #include "webrtc/test/gtest.h" |
32 #include "webrtc/test/testsupport/fileutils.h" | 32 #include "webrtc/test/testsupport/fileutils.h" |
33 | 33 |
34 #import "webrtc/sdk/objc/Framework/Classes/Audio/RTCAudioSession+Private.h" | 34 #import "webrtc/sdk/objc/Framework/Classes/Audio/RTCAudioSession+Private.h" |
35 #import "webrtc/sdk/objc/Framework/Headers/WebRTC/RTCAudioSession.h" | 35 #import "webrtc/sdk/objc/Framework/Headers/WebRTC/RTCAudioSession.h" |
36 | 36 |
37 using std::cout; | 37 using std::cout; |
38 using std::endl; | 38 using std::endl; |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 size_t rec_count_; | 468 size_t rec_count_; |
469 AudioStreamInterface* audio_stream_; | 469 AudioStreamInterface* audio_stream_; |
470 }; | 470 }; |
471 | 471 |
472 // AudioDeviceTest test fixture. | 472 // AudioDeviceTest test fixture. |
473 class AudioDeviceTest : public ::testing::Test { | 473 class AudioDeviceTest : public ::testing::Test { |
474 protected: | 474 protected: |
475 AudioDeviceTest() : test_is_done_(EventWrapper::Create()) { | 475 AudioDeviceTest() : test_is_done_(EventWrapper::Create()) { |
476 old_sev_ = rtc::LogMessage::GetLogToDebug(); | 476 old_sev_ = rtc::LogMessage::GetLogToDebug(); |
477 // Set suitable logging level here. Change to rtc::LS_INFO for more verbose | 477 // Set suitable logging level here. Change to rtc::LS_INFO for more verbose |
478 // output. See webrtc/base/logging.h for complete list of options. | 478 // output. See webrtc/rtc_base/logging.h for complete list of options. |
479 rtc::LogMessage::LogToDebug(rtc::LS_INFO); | 479 rtc::LogMessage::LogToDebug(rtc::LS_INFO); |
480 // Add extra logging fields here (timestamps and thread id). | 480 // Add extra logging fields here (timestamps and thread id). |
481 // rtc::LogMessage::LogTimestamps(); | 481 // rtc::LogMessage::LogTimestamps(); |
482 rtc::LogMessage::LogThreads(); | 482 rtc::LogMessage::LogThreads(); |
483 // Creates an audio device using a default audio layer. | 483 // Creates an audio device using a default audio layer. |
484 audio_device_ = CreateAudioDevice(AudioDeviceModule::kPlatformDefaultAudio); | 484 audio_device_ = CreateAudioDevice(AudioDeviceModule::kPlatformDefaultAudio); |
485 EXPECT_NE(audio_device_.get(), nullptr); | 485 EXPECT_NE(audio_device_.get(), nullptr); |
486 EXPECT_EQ(0, audio_device_->Init()); | 486 EXPECT_EQ(0, audio_device_->Init()); |
487 EXPECT_EQ(0, | 487 EXPECT_EQ(0, |
488 audio_device()->GetPlayoutAudioParameters(&playout_parameters_)); | 488 audio_device()->GetPlayoutAudioParameters(&playout_parameters_)); |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 // Wait for notification to propagate. | 871 // Wait for notification to propagate. |
872 rtc::MessageQueueManager::ProcessAllMessageQueues(); | 872 rtc::MessageQueueManager::ProcessAllMessageQueues(); |
873 EXPECT_TRUE(audio_device->is_interrupted_); | 873 EXPECT_TRUE(audio_device->is_interrupted_); |
874 | 874 |
875 audio_device->Init(); | 875 audio_device->Init(); |
876 audio_device->InitPlayout(); | 876 audio_device->InitPlayout(); |
877 EXPECT_FALSE(audio_device->is_interrupted_); | 877 EXPECT_FALSE(audio_device->is_interrupted_); |
878 } | 878 } |
879 | 879 |
880 } // namespace webrtc | 880 } // namespace webrtc |
OLD | NEW |