Chromium Code Reviews| Index: content/renderer/media/webrtc_audio_device_unittest.cc |
| diff --git a/content/renderer/media/webrtc_audio_device_unittest.cc b/content/renderer/media/webrtc_audio_device_unittest.cc |
| index 37d5401c558b9e1aadfed78d7aadc2ddf2e87135..0384b6c6d3c4adf7d909a5b0ef8c681e64f06808 100644 |
| --- a/content/renderer/media/webrtc_audio_device_unittest.cc |
| +++ b/content/renderer/media/webrtc_audio_device_unittest.cc |
| @@ -11,6 +11,7 @@ |
| #include "content/renderer/media/webrtc_audio_capturer.h" |
| #include "content/renderer/media/webrtc_audio_device_impl.h" |
| #include "content/renderer/media/webrtc_audio_renderer.h" |
| +#include "content/renderer/media/webrtc_local_audio_track.h" |
| #include "content/renderer/render_thread_impl.h" |
| #include "content/test/webrtc_audio_device_test.h" |
| #include "media/audio/audio_manager_base.h" |
| @@ -582,7 +583,13 @@ TEST_F(WebRTCAudioDeviceTest, MAYBE_StartRecording) { |
| ASSERT_EQ(0, err); |
| EXPECT_TRUE(InitializeCapturer(webrtc_audio_device.get())); |
| - webrtc_audio_device->capturer()->Start(); |
| + |
| + // Adds a local audio track to trigger starting the capturer. |
|
henrika (OOO until Aug 14)
2013/06/05 09:09:20
Could you make this comment a bit more clear. "..t
no longer working on chromium
2013/06/05 16:29:45
Done.
|
| + scoped_refptr<WebRtcLocalAudioTrack> local_audio_track( |
| + WebRtcLocalAudioTrack::Create(std::string(), |
| + webrtc_audio_device->capturer(), |
| + NULL)); |
| + local_audio_track->Start(); |
|
henrika (OOO until Aug 14)
2013/06/05 09:09:20
No EXPECT?
no longer working on chromium
2013/06/05 16:29:45
It is void
|
| int ch = base->CreateChannel(); |
| EXPECT_NE(-1, ch); |
| @@ -619,7 +626,7 @@ TEST_F(WebRTCAudioDeviceTest, MAYBE_StartRecording) { |
| ch, webrtc::kRecordingPerChannel)); |
| EXPECT_EQ(0, base->StopSend(ch)); |
| - webrtc_audio_device->capturer()->Stop(); |
| + local_audio_track->Stop(); |
| EXPECT_EQ(0, base->DeleteChannel(ch)); |
| EXPECT_EQ(0, base->Terminate()); |
| } |
| @@ -745,7 +752,12 @@ TEST_F(WebRTCAudioDeviceTest, MAYBE_FullDuplexAudioWithAGC) { |
| ASSERT_EQ(0, err); |
| EXPECT_TRUE(InitializeCapturer(webrtc_audio_device.get())); |
| - webrtc_audio_device->capturer()->Start(); |
| + // Adds a local audio track to trigger starting the capturer. |
|
henrika (OOO until Aug 14)
2013/06/05 09:09:20
dito
no longer working on chromium
2013/06/05 16:29:45
Done.
|
| + scoped_refptr<WebRtcLocalAudioTrack> local_audio_track( |
| + WebRtcLocalAudioTrack::Create(std::string(), |
| + webrtc_audio_device->capturer(), |
| + NULL)); |
| + local_audio_track->Start(); |
| ScopedWebRTCPtr<webrtc::VoEAudioProcessing> audio_processing(engine.get()); |
| ASSERT_TRUE(audio_processing.valid()); |
| @@ -781,7 +793,7 @@ TEST_F(WebRTCAudioDeviceTest, MAYBE_FullDuplexAudioWithAGC) { |
| base::TimeDelta::FromSeconds(2)); |
| message_loop_.Run(); |
| - webrtc_audio_device->capturer()->Stop(); |
| + local_audio_track->Stop(); |
| renderer->Stop(); |
| EXPECT_EQ(0, base->StopSend(ch)); |
| EXPECT_EQ(0, base->StopPlayout(ch)); |
| @@ -815,7 +827,12 @@ TEST_F(WebRTCAudioDeviceTest, WebRtcRecordingSetupTime) { |
| ASSERT_EQ(0, err); |
| EXPECT_TRUE(InitializeCapturer(webrtc_audio_device.get())); |
| - webrtc_audio_device->capturer()->Start(); |
| + // Adds a local audio track to trigger starting the capturer. |
|
henrika (OOO until Aug 14)
2013/06/05 09:09:20
same here
no longer working on chromium
2013/06/05 16:29:45
Done.
|
| + scoped_refptr<WebRtcLocalAudioTrack> local_audio_track( |
| + WebRtcLocalAudioTrack::Create(std::string(), |
| + webrtc_audio_device->capturer(), |
| + NULL)); |
| + local_audio_track->Start(); |
| base::WaitableEvent event(false, false); |
| scoped_ptr<MockWebRtcAudioCapturerSink> capturer_sink( |
| @@ -834,7 +851,7 @@ TEST_F(WebRTCAudioDeviceTest, WebRtcRecordingSetupTime) { |
| PrintPerfResultMs("webrtc_recording_setup_c", "t", delay); |
| capturer->RemoveSink(capturer_sink.get()); |
| - webrtc_audio_device->capturer()->Stop(); |
| + local_audio_track->Stop(); |
| EXPECT_EQ(0, base->StopSend(ch)); |
| EXPECT_EQ(0, base->DeleteChannel(ch)); |
| EXPECT_EQ(0, base->Terminate()); |