blob: 54766caf396d99c62114ab08c46f1934f6939fa2 [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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "pc/localaudiosource.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000012
13#include <string>
14#include <vector>
15
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#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.org28e20752013-07-10 00:45:36 +000020
21using webrtc::LocalAudioSource;
22using webrtc::MediaConstraintsInterface;
23using webrtc::MediaSourceInterface;
24
htaa2a49d92016-03-04 02:51:39 -080025TEST(LocalAudioSourceTest, InitWithAudioOptions) {
26 cricket::AudioOptions audio_options;
Oskar Sundbom36f8f3e2017-11-16 10:54:27 +010027 audio_options.highpass_filter = true;
deadbeef757146b2017-02-10 21:26:48 -080028 rtc::scoped_refptr<LocalAudioSource> source =
29 LocalAudioSource::Create(&audio_options);
Oskar Sundbom36f8f3e2017-11-16 10:54:27 +010030 EXPECT_EQ(true, source->options().highpass_filter);
htaa2a49d92016-03-04 02:51:39 -080031}
32
33TEST(LocalAudioSourceTest, InitWithNoOptions) {
34 rtc::scoped_refptr<LocalAudioSource> source =
Niels Möller2d02e082018-05-21 11:23:35 +020035 LocalAudioSource::Create(nullptr);
Danil Chapovalov66cadcc2018-06-19 16:47:43 +020036 EXPECT_EQ(absl::nullopt, source->options().highpass_filter);
htaa2a49d92016-03-04 02:51:39 -080037}