| 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/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/synchronization/waitable_event.h" | 6 #include "base/synchronization/waitable_event.h" |
| 7 #include "base/test/test_timeouts.h" | 7 #include "base/test/test_timeouts.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "content/public/renderer/media_stream_audio_sink.h" | 9 #include "content/public/renderer/media_stream_audio_sink.h" |
| 10 #include "content/renderer/media/media_stream_audio_source.h" | 10 #include "content/renderer/media/media_stream_audio_source.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } // namespace | 152 } // namespace |
| 153 | 153 |
| 154 class WebRtcLocalAudioTrackTest : public ::testing::Test { | 154 class WebRtcLocalAudioTrackTest : public ::testing::Test { |
| 155 protected: | 155 protected: |
| 156 void SetUp() override { | 156 void SetUp() override { |
| 157 params_.Reset(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, | 157 params_.Reset(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, |
| 158 media::CHANNEL_LAYOUT_STEREO, 48000, 16, 480); | 158 media::CHANNEL_LAYOUT_STEREO, 48000, 16, 480); |
| 159 MockConstraintFactory constraint_factory; | 159 MockConstraintFactory constraint_factory; |
| 160 blink_source_.initialize("dummy", blink::WebMediaStreamSource::TypeAudio, | 160 blink_source_.initialize("dummy", blink::WebMediaStreamSource::TypeAudio, |
| 161 "dummy", | 161 "dummy", |
| 162 false /* remote */, true /* readonly */); | 162 false /* remote */); |
| 163 MediaStreamAudioSource* audio_source = new MediaStreamAudioSource(); | 163 MediaStreamAudioSource* audio_source = new MediaStreamAudioSource(); |
| 164 blink_source_.setExtraData(audio_source); | 164 blink_source_.setExtraData(audio_source); |
| 165 | 165 |
| 166 StreamDeviceInfo device(MEDIA_DEVICE_AUDIO_CAPTURE, | 166 StreamDeviceInfo device(MEDIA_DEVICE_AUDIO_CAPTURE, |
| 167 std::string(), std::string()); | 167 std::string(), std::string()); |
| 168 { | 168 { |
| 169 std::unique_ptr<WebRtcAudioCapturer> capturer = | 169 std::unique_ptr<WebRtcAudioCapturer> capturer = |
| 170 WebRtcAudioCapturer::CreateCapturer( | 170 WebRtcAudioCapturer::CreateCapturer( |
| 171 -1, device, constraint_factory.CreateWebMediaConstraints(), | 171 -1, device, constraint_factory.CreateWebMediaConstraints(), |
| 172 nullptr, audio_source); | 172 nullptr, audio_source); |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 // Stopping the new source will stop the second track. | 570 // Stopping the new source will stop the second track. |
| 571 EXPECT_CALL(*source.get(), OnStop()).Times(1); | 571 EXPECT_CALL(*source.get(), OnStop()).Times(1); |
| 572 capturer->Stop(); | 572 capturer->Stop(); |
| 573 | 573 |
| 574 // Even though this test don't use |capturer_source_| it will be stopped | 574 // Even though this test don't use |capturer_source_| it will be stopped |
| 575 // during teardown of the test harness. | 575 // during teardown of the test harness. |
| 576 EXPECT_CALL(*capturer_source_.get(), OnStop()); | 576 EXPECT_CALL(*capturer_source_.get(), OnStop()); |
| 577 } | 577 } |
| 578 | 578 |
| 579 } // namespace content | 579 } // namespace content |
| OLD | NEW |