| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/audio_track_recorder.h" | 5 #include "content/renderer/media/audio_track_recorder.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 // Adapted from media::WebRTCLocalAudioSourceProviderTest. | 210 // Adapted from media::WebRTCLocalAudioSourceProviderTest. |
| 211 void PrepareBlinkTrack() { | 211 void PrepareBlinkTrack() { |
| 212 scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter( | 212 scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter( |
| 213 WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL)); | 213 WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL)); |
| 214 std::unique_ptr<WebRtcLocalAudioTrack> native_track( | 214 std::unique_ptr<WebRtcLocalAudioTrack> native_track( |
| 215 new WebRtcLocalAudioTrack(adapter.get())); | 215 new WebRtcLocalAudioTrack(adapter.get())); |
| 216 blink::WebMediaStreamSource audio_source; | 216 blink::WebMediaStreamSource audio_source; |
| 217 audio_source.initialize(base::UTF8ToUTF16("dummy_source_id"), | 217 audio_source.initialize(base::UTF8ToUTF16("dummy_source_id"), |
| 218 blink::WebMediaStreamSource::TypeAudio, | 218 blink::WebMediaStreamSource::TypeAudio, |
| 219 base::UTF8ToUTF16("dummy_source_name"), | 219 base::UTF8ToUTF16("dummy_source_name"), |
| 220 false /* remote */, true /* readonly */); | 220 false /* remote */); |
| 221 blink_track_.initialize(blink::WebString::fromUTF8("audio_track"), | 221 blink_track_.initialize(blink::WebString::fromUTF8("audio_track"), |
| 222 audio_source); | 222 audio_source); |
| 223 blink_track_.setExtraData(native_track.release()); | 223 blink_track_.setExtraData(native_track.release()); |
| 224 } | 224 } |
| 225 | 225 |
| 226 DISALLOW_COPY_AND_ASSIGN(AudioTrackRecorderTest); | 226 DISALLOW_COPY_AND_ASSIGN(AudioTrackRecorderTest); |
| 227 }; | 227 }; |
| 228 | 228 |
| 229 TEST_P(AudioTrackRecorderTest, OnData) { | 229 TEST_P(AudioTrackRecorderTest, OnData) { |
| 230 InSequence s; | 230 InSequence s; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 294 |
| 295 if (GetParam().sample_rate % 100) | 295 if (GetParam().sample_rate % 100) |
| 296 audio_track_recorder_->OnData(*GetFirstSourceAudioBus(), TimeTicks::Now()); | 296 audio_track_recorder_->OnData(*GetFirstSourceAudioBus(), TimeTicks::Now()); |
| 297 | 297 |
| 298 run_loop.Run(); | 298 run_loop.Run(); |
| 299 Mock::VerifyAndClearExpectations(this); | 299 Mock::VerifyAndClearExpectations(this); |
| 300 } | 300 } |
| 301 | 301 |
| 302 INSTANTIATE_TEST_CASE_P(, AudioTrackRecorderTest, ValuesIn(kATRTestParams)); | 302 INSTANTIATE_TEST_CASE_P(, AudioTrackRecorderTest, ValuesIn(kATRTestParams)); |
| 303 } // namespace content | 303 } // namespace content |
| OLD | NEW |