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

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

Issue 2425703002: Remove |remote| and |readonly| members of MediaStreamTrack (Closed)
Patch Set: Fixed webkit_tests Created 3 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 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/capturefromelement/html_audio_element_capturer_ source.h" 9 #include "content/renderer/media/capturefromelement/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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 */);
79 audio_source_->Initialize(params, &fake_callback_); 79 audio_source_->Initialize(params, &fake_callback_);
80 80
81 blink_audio_source_.initialize(blink::WebString::fromUTF8("audio_id"), 81 blink_audio_source_.initialize(blink::WebString::fromUTF8("audio_id"),
82 blink::WebMediaStreamSource::TypeAudio, 82 blink::WebMediaStreamSource::TypeAudio,
83 blink::WebString::fromUTF8("audio_track"), 83 blink::WebString::fromUTF8("audio_track"));
84 false /* remote */);
85 blink_audio_track_.initialize(blink_audio_source_.id(), 84 blink_audio_track_.initialize(blink_audio_source_.id(),
86 blink_audio_source_); 85 blink_audio_source_);
87 86
88 // |blink_audio_source_| takes ownership of HtmlAudioElementCapturerSource. 87 // |blink_audio_source_| takes ownership of HtmlAudioElementCapturerSource.
89 blink_audio_source_.setExtraData( 88 blink_audio_source_.setExtraData(
90 new HtmlAudioElementCapturerSource(audio_source_.get())); 89 new HtmlAudioElementCapturerSource(audio_source_.get()));
91 ASSERT_TRUE(source()->ConnectToTrack(blink_audio_track_)); 90 ASSERT_TRUE(source()->ConnectToTrack(blink_audio_track_));
92 } 91 }
93 92
94 void TearDown() override { 93 void TearDown() override {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 std::unique_ptr<media::AudioBus> bus = media::AudioBus::Create( 146 std::unique_ptr<media::AudioBus> bus = media::AudioBus::Create(
148 kNumChannelsForTest, kAudioTrackSamplesPerBuffer); 147 kNumChannelsForTest, kAudioTrackSamplesPerBuffer);
149 InjectAudio(bus.get()); 148 InjectAudio(bus.get());
150 run_loop.Run(); 149 run_loop.Run();
151 150
152 track()->Stop(); 151 track()->Stop();
153 track()->RemoveSink(&sink); 152 track()->RemoveSink(&sink);
154 } 153 }
155 154
156 } // namespace content 155 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698