| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "content/public/common/content_switches.h" | 7 #include "content/public/common/content_switches.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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 media::AudioParameters params_; | 153 media::AudioParameters params_; |
| 154 scoped_refptr<MockCapturerSource> capturer_source_; | 154 scoped_refptr<MockCapturerSource> capturer_source_; |
| 155 scoped_refptr<WebRtcAudioCapturer> capturer_; | 155 scoped_refptr<WebRtcAudioCapturer> capturer_; |
| 156 scoped_ptr<WebRtcLocalAudioTrack> track_; | 156 scoped_ptr<WebRtcLocalAudioTrack> track_; |
| 157 }; | 157 }; |
| 158 | 158 |
| 159 // Pass the delay value, volume and key_pressed info via capture callback, and | 159 // Pass the delay value, volume and key_pressed info via capture callback, and |
| 160 // those values should be correctly stored and passed to the track. | 160 // those values should be correctly stored and passed to the track. |
| 161 TEST_F(WebRtcAudioCapturerTest, VerifyAudioParams) { | 161 TEST_F(WebRtcAudioCapturerTest, VerifyAudioParams) { |
| 162 // Use constraints with default settings. | 162 // Use constraints with default settings. |
| 163 blink::WebMediaConstraints constraints; | 163 MockMediaConstraintFactory constraint_factory; |
| 164 VerifyAudioParams(constraints, true); | 164 VerifyAudioParams(constraint_factory.CreateWebMediaConstraints(), true); |
| 165 } | 165 } |
| 166 | 166 |
| 167 TEST_F(WebRtcAudioCapturerTest, VerifyAudioParamsWithAudioProcessing) { | 167 TEST_F(WebRtcAudioCapturerTest, VerifyAudioParamsWithAudioProcessing) { |
| 168 EnableAudioTrackProcessing(); | 168 EnableAudioTrackProcessing(); |
| 169 // Turn off the default constraints to verify that the sink will get packets | 169 // Turn off the default constraints to verify that the sink will get packets |
| 170 // with a buffer size smaller than 10ms. | 170 // with a buffer size smaller than 10ms. |
| 171 MockMediaConstraintFactory constraint_factory; | 171 MockMediaConstraintFactory constraint_factory; |
| 172 constraint_factory.DisableDefaultAudioConstraints(); | 172 constraint_factory.DisableDefaultAudioConstraints(); |
| 173 VerifyAudioParams(constraint_factory.CreateWebMediaConstraints(), false); | 173 VerifyAudioParams(constraint_factory.CreateWebMediaConstraints(), false); |
| 174 } | 174 } |
| 175 | 175 |
| 176 } // namespace content | 176 } // namespace content |
| OLD | NEW |