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

Side by Side Diff: content/renderer/media/webrtc_local_audio_source_provider_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/renderer/media/media_stream_audio_track.h" 8 #include "content/renderer/media/media_stream_audio_track.h"
9 #include "content/renderer/media/webrtc_local_audio_source_provider.h" 9 #include "content/renderer/media/webrtc_local_audio_source_provider.h"
10 #include "media/base/audio_bus.h" 10 #include "media/base/audio_bus.h"
(...skipping 11 matching lines...) Expand all
22 source_params_.Reset(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, 22 source_params_.Reset(media::AudioParameters::AUDIO_PCM_LOW_LATENCY,
23 media::CHANNEL_LAYOUT_MONO, 48000, 16, 480); 23 media::CHANNEL_LAYOUT_MONO, 48000, 16, 480);
24 sink_params_.Reset( 24 sink_params_.Reset(
25 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, 25 media::AudioParameters::AUDIO_PCM_LOW_LATENCY,
26 media::CHANNEL_LAYOUT_STEREO, 44100, 16, 26 media::CHANNEL_LAYOUT_STEREO, 44100, 16,
27 WebRtcLocalAudioSourceProvider::kWebAudioRenderBufferSize); 27 WebRtcLocalAudioSourceProvider::kWebAudioRenderBufferSize);
28 sink_bus_ = media::AudioBus::Create(sink_params_); 28 sink_bus_ = media::AudioBus::Create(sink_params_);
29 blink::WebMediaStreamSource audio_source; 29 blink::WebMediaStreamSource audio_source;
30 audio_source.initialize(blink::WebString::fromUTF8("dummy_source_id"), 30 audio_source.initialize(blink::WebString::fromUTF8("dummy_source_id"),
31 blink::WebMediaStreamSource::TypeAudio, 31 blink::WebMediaStreamSource::TypeAudio,
32 blink::WebString::fromUTF8("dummy_source_name"), 32 blink::WebString::fromUTF8("dummy_source_name"));
33 false /* remote */);
34 blink_track_.initialize(blink::WebString::fromUTF8("audio_track"), 33 blink_track_.initialize(blink::WebString::fromUTF8("audio_track"),
35 audio_source); 34 audio_source);
36 blink_track_.setTrackData(new MediaStreamAudioTrack(true)); 35 blink_track_.setTrackData(new MediaStreamAudioTrack(true));
37 source_provider_.reset(new WebRtcLocalAudioSourceProvider(blink_track_)); 36 source_provider_.reset(new WebRtcLocalAudioSourceProvider(blink_track_));
38 source_provider_->SetSinkParamsForTesting(sink_params_); 37 source_provider_->SetSinkParamsForTesting(sink_params_);
39 source_provider_->OnSetFormat(source_params_); 38 source_provider_->OnSetFormat(source_params_);
40 } 39 }
41 40
42 void TearDown() override { 41 void TearDown() override {
43 source_provider_.reset(); 42 source_provider_.reset();
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 TEST_F(WebRtcLocalAudioSourceProviderTest, 123 TEST_F(WebRtcLocalAudioSourceProviderTest,
125 StopTrackBeforeDeletingSourceProvider) { 124 StopTrackBeforeDeletingSourceProvider) {
126 // Stop the audio track. 125 // Stop the audio track.
127 MediaStreamAudioTrack::From(blink_track_)->Stop(); 126 MediaStreamAudioTrack::From(blink_track_)->Stop();
128 127
129 // Delete the source provider. 128 // Delete the source provider.
130 source_provider_.reset(); 129 source_provider_.reset();
131 } 130 }
132 131
133 } // namespace content 132 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698