| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" | 5 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" |
| 6 #include "content/renderer/media/webrtc_local_audio_track.h" | 6 #include "content/renderer/media/webrtc_local_audio_track.h" |
| 7 #include "testing/gmock/include/gmock/gmock.h" | 7 #include "testing/gmock/include/gmock/gmock.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" | 9 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 } // namespace | 29 } // namespace |
| 30 | 30 |
| 31 class WebRtcLocalAudioTrackAdapterTest : public ::testing::Test { | 31 class WebRtcLocalAudioTrackAdapterTest : public ::testing::Test { |
| 32 public: | 32 public: |
| 33 WebRtcLocalAudioTrackAdapterTest() | 33 WebRtcLocalAudioTrackAdapterTest() |
| 34 : params_(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, | 34 : params_(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, |
| 35 media::CHANNEL_LAYOUT_STEREO, 48000, 16, 480), | 35 media::CHANNEL_LAYOUT_STEREO, 48000, 16, 480), |
| 36 adapter_(WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL)), | 36 adapter_(WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL)), |
| 37 capturer_(WebRtcAudioCapturer::CreateCapturer( | 37 capturer_(WebRtcAudioCapturer::CreateCapturer( |
| 38 -1, StreamDeviceInfo(MEDIA_DEVICE_AUDIO_CAPTURE, "", ""), | 38 -1, StreamDeviceInfo(MEDIA_DEVICE_AUDIO_CAPTURE, "", ""), |
| 39 blink::WebMediaConstraints(), NULL)), | 39 blink::WebMediaConstraints(), NULL, NULL)), |
| 40 track_(new WebRtcLocalAudioTrack(adapter_, capturer_, NULL)) {} | 40 track_(new WebRtcLocalAudioTrack(adapter_, capturer_, NULL)) {} |
| 41 | 41 |
| 42 protected: | 42 protected: |
| 43 virtual void SetUp() OVERRIDE { | 43 virtual void SetUp() OVERRIDE { |
| 44 track_->OnSetFormat(params_); | 44 track_->OnSetFormat(params_); |
| 45 EXPECT_TRUE(track_->GetAudioAdapter()->enabled()); | 45 EXPECT_TRUE(track_->GetAudioAdapter()->enabled()); |
| 46 } | 46 } |
| 47 | 47 |
| 48 media::AudioParameters params_; | 48 media::AudioParameters params_; |
| 49 scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter_; | 49 scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter_; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 73 | 73 |
| 74 // Remove the sink from the webrtc track. | 74 // Remove the sink from the webrtc track. |
| 75 webrtc_track->RemoveSink(sink.get()); | 75 webrtc_track->RemoveSink(sink.get()); |
| 76 sink.reset(); | 76 sink.reset(); |
| 77 | 77 |
| 78 // Verify that no more callback gets into the sink. | 78 // Verify that no more callback gets into the sink. |
| 79 track_->Capture(data.get(), base::TimeDelta(), 255, false, false); | 79 track_->Capture(data.get(), base::TimeDelta(), 255, false, false); |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace content | 82 } // namespace content |
| OLD | NEW |