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

Side by Side Diff: content/renderer/media/html_audio_element_capturer_source_unittest.cc

Issue 2567143002: media::SilentSinkSuspender should simulate |delay| and |delay_timestamp| (Closed)
Patch Set: build fix content_unittets & media_blink_unittsests Created 3 years, 11 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "base/memory/weak_ptr.h" 5 #include "base/memory/weak_ptr.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "base/threading/thread_task_runner_handle.h" 7 #include "base/threading/thread_task_runner_handle.h"
8 #include "content/public/renderer/media_stream_audio_sink.h" 8 #include "content/public/renderer/media_stream_audio_sink.h"
9 #include "content/renderer/media/html_audio_element_capturer_source.h" 9 #include "content/renderer/media/html_audio_element_capturer_source.h"
10 #include "content/renderer/media/media_stream_audio_track.h" 10 #include "content/renderer/media/media_stream_audio_track.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // and inject audio. 58 // and inject audio.
59 // - a WebMediaStreamSource, that owns the HTMLAudioElementCapturerSource under 59 // - a WebMediaStreamSource, that owns the HTMLAudioElementCapturerSource under
60 // test, and a WebMediaStreamAudioTrack, that the class under test needs to 60 // test, and a WebMediaStreamAudioTrack, that the class under test needs to
61 // connect to in order to operate correctly. This class has an inner content 61 // connect to in order to operate correctly. This class has an inner content
62 // MediaStreamAudioTrack. 62 // MediaStreamAudioTrack.
63 // - finally, a MockMediaStreamAudioSink to observe captured audio frames, and 63 // - finally, a MockMediaStreamAudioSink to observe captured audio frames, and
64 // that plugs into the former MediaStreamAudioTrack. 64 // that plugs into the former MediaStreamAudioTrack.
65 class HTMLAudioElementCapturerSourceTest : public testing::Test { 65 class HTMLAudioElementCapturerSourceTest : public testing::Test {
66 public: 66 public:
67 HTMLAudioElementCapturerSourceTest() 67 HTMLAudioElementCapturerSourceTest()
68 : fake_callback_(0.1), 68 : fake_callback_(0.1, kAudioTrackSampleRate),
69 audio_source_(new media::WebAudioSourceProviderImpl( 69 audio_source_(new media::WebAudioSourceProviderImpl(
70 new media::NullAudioSink(base::ThreadTaskRunnerHandle::Get()), 70 new media::NullAudioSink(base::ThreadTaskRunnerHandle::Get()),
71 new media::MediaLog())) {} 71 new media::MediaLog())) {}
72 72
73 void SetUp() final { 73 void SetUp() final {
74 const media::AudioParameters params( 74 const media::AudioParameters params(
75 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, 75 media::AudioParameters::AUDIO_PCM_LOW_LATENCY,
76 media::GuessChannelLayout(kNumChannelsForTest), 76 media::GuessChannelLayout(kNumChannelsForTest),
77 kAudioTrackSampleRate /* sample_rate */, 16 /* bits_per_sample */, 77 kAudioTrackSampleRate /* sample_rate */, 16 /* bits_per_sample */,
78 kAudioTrackSamplesPerBuffer /* frames_per_buffer */); 78 kAudioTrackSamplesPerBuffer /* frames_per_buffer */);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 std::unique_ptr<media::AudioBus> bus = media::AudioBus::Create( 147 std::unique_ptr<media::AudioBus> bus = media::AudioBus::Create(
148 kNumChannelsForTest, kAudioTrackSamplesPerBuffer); 148 kNumChannelsForTest, kAudioTrackSamplesPerBuffer);
149 InjectAudio(bus.get()); 149 InjectAudio(bus.get());
150 run_loop.Run(); 150 run_loop.Run();
151 151
152 track()->Stop(); 152 track()->Stop();
153 track()->RemoveSink(&sink); 153 track()->RemoveSink(&sink);
154 } 154 }
155 155
156 } // namespace content 156 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/audio_renderer_mixer_manager_unittest.cc ('k') | media/base/audio_bus_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698