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

Unified Diff: content/renderer/media/media_stream_audio_processor_unittest.cc

Issue 671793004: Clean up the media stream audio track code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/media_stream_audio_processor_unittest.cc
diff --git a/content/renderer/media/media_stream_audio_processor_unittest.cc b/content/renderer/media/media_stream_audio_processor_unittest.cc
index 91d7b32847d2cdc6ca2c40601bca24a55ec5e37d..16d667562c059a7d605dc2b80859f72e07d7a840 100644
--- a/content/renderer/media/media_stream_audio_processor_unittest.cc
+++ b/content/renderer/media/media_stream_audio_processor_unittest.cc
@@ -2,14 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/memory/aligned_memory.h"
#include "base/path_service.h"
#include "base/time/time.h"
-#include "content/public/common/content_switches.h"
#include "content/public/common/media_stream_request.h"
#include "content/renderer/media/media_stream_audio_processor.h"
#include "content/renderer/media/media_stream_audio_processor_options.h"
@@ -175,29 +173,6 @@ class MediaStreamAudioProcessorTest : public ::testing::Test {
media::AudioParameters params_;
};
-TEST_F(MediaStreamAudioProcessorTest, WithoutAudioProcessing) {
- // Setup the audio processor with disabled flag on.
- CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kDisableAudioTrackProcessing);
- MockMediaConstraintFactory constraint_factory;
- scoped_refptr<WebRtcAudioDeviceImpl> webrtc_audio_device(
- new WebRtcAudioDeviceImpl());
- scoped_refptr<MediaStreamAudioProcessor> audio_processor(
- new rtc::RefCountedObject<MediaStreamAudioProcessor>(
- constraint_factory.CreateWebMediaConstraints(), 0,
- webrtc_audio_device.get()));
- EXPECT_FALSE(audio_processor->has_audio_processing());
- audio_processor->OnCaptureFormatChanged(params_);
-
- ProcessDataAndVerifyFormat(audio_processor.get(),
- params_.sample_rate(),
- params_.channels(),
- params_.sample_rate() / 100);
- // Set |audio_processor| to NULL to make sure |webrtc_audio_device| outlives
- // |audio_processor|.
- audio_processor = NULL;
-}
-
TEST_F(MediaStreamAudioProcessorTest, WithAudioProcessing) {
MockMediaConstraintFactory constraint_factory;
scoped_refptr<WebRtcAudioDeviceImpl> webrtc_audio_device(
@@ -355,7 +330,6 @@ TEST_F(MediaStreamAudioProcessorTest, VerifyConstraints) {
for (size_t i = 0; i < arraysize(kDefaultAudioConstraints); ++i) {
EXPECT_FALSE(audio_constraints.GetProperty(kDefaultAudioConstraints[i]));
}
- EXPECT_FALSE(audio_constraints.NeedsAudioProcessing());
#if defined(OS_WIN)
EXPECT_TRUE(audio_constraints.GetProperty(kMediaStreamAudioDucking));
#else
@@ -516,33 +490,4 @@ TEST_F(MediaStreamAudioProcessorTest, TestWithKeyboardMicChannel) {
audio_processor = NULL;
}
-TEST_F(MediaStreamAudioProcessorTest,
- TestWithKeyboardMicChannelWithoutProcessing) {
- // Setup the audio processor with disabled flag on.
- CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kDisableAudioTrackProcessing);
- MockMediaConstraintFactory constraint_factory;
- scoped_refptr<WebRtcAudioDeviceImpl> webrtc_audio_device(
- new WebRtcAudioDeviceImpl());
- scoped_refptr<MediaStreamAudioProcessor> audio_processor(
- new rtc::RefCountedObject<MediaStreamAudioProcessor>(
- constraint_factory.CreateWebMediaConstraints(), 0,
- webrtc_audio_device.get()));
- EXPECT_FALSE(audio_processor->has_audio_processing());
-
- media::AudioParameters params(media::AudioParameters::AUDIO_PCM_LOW_LATENCY,
- media::CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC,
- 48000, 16, 512);
- audio_processor->OnCaptureFormatChanged(params);
-
- ProcessDataAndVerifyFormat(
- audio_processor.get(),
- params.sample_rate(),
- media::ChannelLayoutToChannelCount(media::CHANNEL_LAYOUT_STEREO),
- params.sample_rate() / 100);
- // Set |audio_processor| to NULL to make sure |webrtc_audio_device| outlives
- // |audio_processor|.
- audio_processor = NULL;
-}
-
} // namespace content
« no previous file with comments | « content/renderer/media/media_stream_audio_processor_options.cc ('k') | content/renderer/media/media_stream_audio_sink_owner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698