OLD | NEW |
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 "base/synchronization/waitable_event.h" | 5 #include "base/synchronization/waitable_event.h" |
6 #include "base/test/test_timeouts.h" | 6 #include "base/test/test_timeouts.h" |
7 #include "content/renderer/media/media_stream_audio_source.h" | 7 #include "content/renderer/media/media_stream_audio_source.h" |
8 #include "content/renderer/media/mock_media_constraint_factory.h" | 8 #include "content/renderer/media/mock_media_constraint_factory.h" |
9 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" | 9 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" |
10 #include "content/renderer/media/webrtc_audio_capturer.h" | 10 #include "content/renderer/media/webrtc_audio_capturer.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 private: | 162 private: |
163 media::AudioParameters params_; | 163 media::AudioParameters params_; |
164 }; | 164 }; |
165 | 165 |
166 } // namespace | 166 } // namespace |
167 | 167 |
168 class WebRtcLocalAudioTrackTest : public ::testing::Test { | 168 class WebRtcLocalAudioTrackTest : public ::testing::Test { |
169 protected: | 169 protected: |
170 virtual void SetUp() OVERRIDE { | 170 virtual void SetUp() OVERRIDE { |
171 params_.Reset(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, | 171 params_.Reset(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, |
172 media::CHANNEL_LAYOUT_STEREO, 2, 0, 48000, 16, 480); | 172 media::CHANNEL_LAYOUT_STEREO, 2, 48000, 16, 480); |
173 MockMediaConstraintFactory constraint_factory; | 173 MockMediaConstraintFactory constraint_factory; |
174 blink_source_.initialize("dummy", blink::WebMediaStreamSource::TypeAudio, | 174 blink_source_.initialize("dummy", blink::WebMediaStreamSource::TypeAudio, |
175 "dummy"); | 175 "dummy"); |
176 MediaStreamAudioSource* audio_source = new MediaStreamAudioSource(); | 176 MediaStreamAudioSource* audio_source = new MediaStreamAudioSource(); |
177 blink_source_.setExtraData(audio_source); | 177 blink_source_.setExtraData(audio_source); |
178 | 178 |
179 StreamDeviceInfo device(MEDIA_DEVICE_AUDIO_CAPTURE, | 179 StreamDeviceInfo device(MEDIA_DEVICE_AUDIO_CAPTURE, |
180 std::string(), std::string()); | 180 std::string(), std::string()); |
181 capturer_ = WebRtcAudioCapturer::CreateCapturer( | 181 capturer_ = WebRtcAudioCapturer::CreateCapturer( |
182 -1, device, constraint_factory.CreateWebMediaConstraints(), NULL, | 182 -1, device, constraint_factory.CreateWebMediaConstraints(), NULL, |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 // Stopping the new source will stop the second track. | 528 // Stopping the new source will stop the second track. |
529 EXPECT_CALL(*source, OnStop()).Times(1); | 529 EXPECT_CALL(*source, OnStop()).Times(1); |
530 capturer->Stop(); | 530 capturer->Stop(); |
531 | 531 |
532 // Even though this test don't use |capturer_source_| it will be stopped | 532 // Even though this test don't use |capturer_source_| it will be stopped |
533 // during teardown of the test harness. | 533 // during teardown of the test harness. |
534 EXPECT_CALL(*capturer_source_.get(), OnStop()); | 534 EXPECT_CALL(*capturer_source_.get(), OnStop()); |
535 } | 535 } |
536 | 536 |
537 } // namespace content | 537 } // namespace content |
OLD | NEW |