blob: 76d3b366c3efaf7951a2e2f398980fa742971a0d [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001/*
kjellanderb24317b2016-02-10 07:54:43 -08002 * Copyright 2013 The WebRTC project authors. All Rights Reserved.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00003 *
kjellanderb24317b2016-02-10 07:54:43 -08004 * 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.org28e20752013-07-10 00:45:36 +00009 */
10
Steve Anton10542f22019-01-11 09:11:00 -080011#include "pc/local_audio_source.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000012
Yves Gerey3e707812018-11-28 16:47:49 +010013#include "absl/types/optional.h"
14#include "test/gtest.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000015
16using webrtc::LocalAudioSource;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000017
htaa2a49d92016-03-04 02:51:39 -080018TEST(LocalAudioSourceTest, InitWithAudioOptions) {
19 cricket::AudioOptions audio_options;
Oskar Sundbom36f8f3e2017-11-16 10:54:27 +010020 audio_options.highpass_filter = true;
deadbeef757146b2017-02-10 21:26:48 -080021 rtc::scoped_refptr<LocalAudioSource> source =
22 LocalAudioSource::Create(&audio_options);
Oskar Sundbom36f8f3e2017-11-16 10:54:27 +010023 EXPECT_EQ(true, source->options().highpass_filter);
htaa2a49d92016-03-04 02:51:39 -080024}
25
26TEST(LocalAudioSourceTest, InitWithNoOptions) {
27 rtc::scoped_refptr<LocalAudioSource> source =
Niels Möller2d02e082018-05-21 11:23:35 +020028 LocalAudioSource::Create(nullptr);
Danil Chapovalov66cadcc2018-06-19 16:47:43 +020029 EXPECT_EQ(absl::nullopt, source->options().highpass_filter);
htaa2a49d92016-03-04 02:51:39 -080030}