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

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

Issue 2425703002: Remove |remote| and |readonly| members of MediaStreamTrack (Closed)
Patch Set: Created 4 years, 2 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 void SetUp() final { 71 void SetUp() final {
72 const media::AudioParameters params( 72 const media::AudioParameters params(
73 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, 73 media::AudioParameters::AUDIO_PCM_LOW_LATENCY,
74 media::GuessChannelLayout(kNumChannelsForTest), 74 media::GuessChannelLayout(kNumChannelsForTest),
75 kAudioTrackSampleRate /* sample_rate */, 16 /* bits_per_sample */, 75 kAudioTrackSampleRate /* sample_rate */, 16 /* bits_per_sample */,
76 kAudioTrackSamplesPerBuffer /* frames_per_buffer */); 76 kAudioTrackSamplesPerBuffer /* frames_per_buffer */);
77 audio_source_->Initialize(params, &fake_callback_); 77 audio_source_->Initialize(params, &fake_callback_);
78 78
79 blink_audio_source_.initialize(blink::WebString::fromUTF8("audio_id"), 79 blink_audio_source_.initialize(blink::WebString::fromUTF8("audio_id"),
80 blink::WebMediaStreamSource::TypeAudio, 80 blink::WebMediaStreamSource::TypeAudio,
81 blink::WebString::fromUTF8("audio_track"), 81 blink::WebString::fromUTF8("audio_track"));
82 false /* remote */);
83 blink_audio_track_.initialize(blink_audio_source_.id(), 82 blink_audio_track_.initialize(blink_audio_source_.id(),
84 blink_audio_source_); 83 blink_audio_source_);
85 84
86 // |blink_audio_source_| takes ownership of HtmlAudioElementCapturerSource. 85 // |blink_audio_source_| takes ownership of HtmlAudioElementCapturerSource.
87 blink_audio_source_.setExtraData( 86 blink_audio_source_.setExtraData(
88 new HtmlAudioElementCapturerSource(audio_source_.get())); 87 new HtmlAudioElementCapturerSource(audio_source_.get()));
89 ASSERT_TRUE(source()->ConnectToTrack(blink_audio_track_)); 88 ASSERT_TRUE(source()->ConnectToTrack(blink_audio_track_));
90 } 89 }
91 90
92 void TearDown() override { 91 void TearDown() override {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 std::unique_ptr<media::AudioBus> bus = media::AudioBus::Create( 144 std::unique_ptr<media::AudioBus> bus = media::AudioBus::Create(
146 kNumChannelsForTest, kAudioTrackSamplesPerBuffer); 145 kNumChannelsForTest, kAudioTrackSamplesPerBuffer);
147 InjectAudio(bus.get()); 146 InjectAudio(bus.get());
148 run_loop.Run(); 147 run_loop.Run();
149 148
150 track()->Stop(); 149 track()->Stop();
151 track()->RemoveSink(&sink); 150 track()->RemoveSink(&sink);
152 } 151 }
153 152
154 } // namespace content 153 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698