henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 1 | /* |
kjellander | b24317b | 2016-02-10 07:54:43 -0800 | [diff] [blame] | 2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 3 | * |
kjellander | b24317b | 2016-02-10 07:54:43 -0800 | [diff] [blame] | 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #include "pc/localaudiosource.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 12 | |
| 13 | #include <string> |
| 14 | #include <vector> |
| 15 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 16 | #include "api/test/fakeconstraints.h" |
| 17 | #include "media/base/fakemediaengine.h" |
| 18 | #include "media/base/fakevideorenderer.h" |
| 19 | #include "rtc_base/gunit.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 20 | |
| 21 | using webrtc::LocalAudioSource; |
| 22 | using webrtc::MediaConstraintsInterface; |
| 23 | using webrtc::MediaSourceInterface; |
| 24 | |
hta | a2a49d9 | 2016-03-04 02:51:39 -0800 | [diff] [blame] | 25 | TEST(LocalAudioSourceTest, InitWithAudioOptions) { |
| 26 | cricket::AudioOptions audio_options; |
Oskar Sundbom | 36f8f3e | 2017-11-16 10:54:27 +0100 | [diff] [blame] | 27 | audio_options.highpass_filter = true; |
deadbeef | 757146b | 2017-02-10 21:26:48 -0800 | [diff] [blame] | 28 | rtc::scoped_refptr<LocalAudioSource> source = |
| 29 | LocalAudioSource::Create(&audio_options); |
Oskar Sundbom | 36f8f3e | 2017-11-16 10:54:27 +0100 | [diff] [blame] | 30 | EXPECT_EQ(true, source->options().highpass_filter); |
hta | a2a49d9 | 2016-03-04 02:51:39 -0800 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | TEST(LocalAudioSourceTest, InitWithNoOptions) { |
| 34 | rtc::scoped_refptr<LocalAudioSource> source = |
Niels Möller | 2d02e08 | 2018-05-21 11:23:35 +0200 | [diff] [blame] | 35 | LocalAudioSource::Create(nullptr); |
Danil Chapovalov | 66cadcc | 2018-06-19 16:47:43 +0200 | [diff] [blame] | 36 | EXPECT_EQ(absl::nullopt, source->options().highpass_filter); |
hta | a2a49d9 | 2016-03-04 02:51:39 -0800 | [diff] [blame] | 37 | } |