Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Side by Side Diff: content/renderer/media/webrtc/webrtc_local_audio_track_adapter_unittest.cc

Issue 190713004: Only turn on the audio processing by default for MEDIA_DEVICE_AUDIO_CAPTURE (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: unittest Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" 5 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h"
6 #include "content/renderer/media/webrtc_local_audio_track.h" 6 #include "content/renderer/media/webrtc_local_audio_track.h"
7 #include "testing/gmock/include/gmock/gmock.h" 7 #include "testing/gmock/include/gmock/gmock.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" 9 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h"
10 10
(...skipping 17 matching lines...) Expand all
28 28
29 } // namespace 29 } // namespace
30 30
31 class WebRtcLocalAudioTrackAdapterTest : public ::testing::Test { 31 class WebRtcLocalAudioTrackAdapterTest : public ::testing::Test {
32 public: 32 public:
33 WebRtcLocalAudioTrackAdapterTest() 33 WebRtcLocalAudioTrackAdapterTest()
34 : params_(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, 34 : params_(media::AudioParameters::AUDIO_PCM_LOW_LATENCY,
35 media::CHANNEL_LAYOUT_STEREO, 48000, 16, 480), 35 media::CHANNEL_LAYOUT_STEREO, 48000, 16, 480),
36 adapter_(WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL)), 36 adapter_(WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL)),
37 capturer_(WebRtcAudioCapturer::CreateCapturer( 37 capturer_(WebRtcAudioCapturer::CreateCapturer(
38 -1, StreamDeviceInfo(), blink::WebMediaConstraints(), NULL)), 38 -1, StreamDeviceInfo(MEDIA_DEVICE_AUDIO_CAPTURE, "", ""),
39 blink::WebMediaConstraints(), NULL)),
39 track_(new WebRtcLocalAudioTrack(adapter_, capturer_, NULL)) {} 40 track_(new WebRtcLocalAudioTrack(adapter_, capturer_, NULL)) {}
40 41
41 protected: 42 protected:
42 virtual void SetUp() OVERRIDE { 43 virtual void SetUp() OVERRIDE {
43 static_cast<WebRtcLocalAudioSourceProvider*>( 44 static_cast<WebRtcLocalAudioSourceProvider*>(
44 track_->audio_source_provider())->SetSinkParamsForTesting(params_); 45 track_->audio_source_provider())->SetSinkParamsForTesting(params_);
45 track_->OnSetFormat(params_); 46 track_->OnSetFormat(params_);
46 EXPECT_TRUE(track_->GetAudioAdapter()->enabled()); 47 EXPECT_TRUE(track_->GetAudioAdapter()->enabled());
47 } 48 }
48 49
(...skipping 25 matching lines...) Expand all
74 75
75 // Remove the sink from the webrtc track. 76 // Remove the sink from the webrtc track.
76 webrtc_track->RemoveSink(sink.get()); 77 webrtc_track->RemoveSink(sink.get());
77 sink.reset(); 78 sink.reset();
78 79
79 // Verify that no more callback gets into the sink. 80 // Verify that no more callback gets into the sink.
80 track_->Capture(data.get(), base::TimeDelta(), 255, false, false); 81 track_->Capture(data.get(), base::TimeDelta(), 255, false, false);
81 } 82 }
82 83
83 } // namespace content 84 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_audio_processor_unittest.cc ('k') | content/renderer/media/webrtc_audio_capturer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698