henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 1 | /* |
kjellander | b24317b | 2016-02-10 15:54:43 | [diff] [blame] | 2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 3 | * |
kjellander | b24317b | 2016-02-10 15:54:43 | [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 | [diff] [blame] | 9 | */ |
| 10 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 11 | #include "pc/local_audio_source.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 12 | |
Yves Gerey | 3e70781 | 2018-11-28 15:47:49 | [diff] [blame] | 13 | #include "absl/types/optional.h" |
| 14 | #include "test/gtest.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 15 | |
| 16 | using webrtc::LocalAudioSource; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 17 | |
hta | a2a49d9 | 2016-03-04 10:51:39 | [diff] [blame] | 18 | TEST(LocalAudioSourceTest, InitWithAudioOptions) { |
| 19 | cricket::AudioOptions audio_options; |
Oskar Sundbom | 36f8f3e | 2017-11-16 09:54:27 | [diff] [blame] | 20 | audio_options.highpass_filter = true; |
deadbeef | 757146b | 2017-02-11 05:26:48 | [diff] [blame] | 21 | rtc::scoped_refptr<LocalAudioSource> source = |
| 22 | LocalAudioSource::Create(&audio_options); |
Oskar Sundbom | 36f8f3e | 2017-11-16 09:54:27 | [diff] [blame] | 23 | EXPECT_EQ(true, source->options().highpass_filter); |
hta | a2a49d9 | 2016-03-04 10:51:39 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | TEST(LocalAudioSourceTest, InitWithNoOptions) { |
| 27 | rtc::scoped_refptr<LocalAudioSource> source = |
Niels Möller | 2d02e08 | 2018-05-21 09:23:35 | [diff] [blame] | 28 | LocalAudioSource::Create(nullptr); |
Danil Chapovalov | 66cadcc | 2018-06-19 14:47:43 | [diff] [blame] | 29 | EXPECT_EQ(absl::nullopt, source->options().highpass_filter); |
hta | a2a49d9 | 2016-03-04 10:51:39 | [diff] [blame] | 30 | } |