Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Unified Diff: content/renderer/media/audio_track_recorder_unittest.cc

Issue 1647773002: MediaStream audio sourcing: Bypass audio processing for non-WebRTC cases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NOT FOR REVIEW -- This will be broken-up across multiple CLs. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/audio_track_recorder_unittest.cc
diff --git a/content/renderer/media/audio_track_recorder_unittest.cc b/content/renderer/media/audio_track_recorder_unittest.cc
index 2c5d23fb534be0631f1cbd15c5fdb9878fd4f1f5..0aac90dce87f6df62dd7285a52938c3504ef23ac 100644
--- a/content/renderer/media/audio_track_recorder_unittest.cc
+++ b/content/renderer/media/audio_track_recorder_unittest.cc
@@ -6,17 +6,16 @@
#include <stdint.h>
+#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/macros.h"
#include "base/run_loop.h"
#include "base/stl_util.h"
-#include "base/strings/utf_string_conversions.h"
#include "content/renderer/media/media_stream_audio_source.h"
-#include "content/renderer/media/mock_media_constraint_factory.h"
-#include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h"
-#include "content/renderer/media/webrtc_local_audio_track.h"
#include "media/audio/simple_sources.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/web/WebHeap.h"
#include "third_party/opus/src/include/opus.h"
@@ -207,25 +206,18 @@ class AudioTrackRecorderTest : public TestWithParam<ATRTestParams> {
private:
// Prepares a blink track of a given MediaStreamType and attaches the native
// track, which can be used to capture audio data and pass it to the producer.
- // Adapted from media::WebRTCLocalAudioSourceProviderTest.
void PrepareBlinkTrack() {
- MockMediaConstraintFactory constraint_factory;
- scoped_refptr<WebRtcAudioCapturer> capturer(
- WebRtcAudioCapturer::CreateCapturer(
- -1, StreamDeviceInfo(),
- constraint_factory.CreateWebMediaConstraints(), NULL, NULL));
- scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter(
- WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL));
- scoped_ptr<WebRtcLocalAudioTrack> native_track(
- new WebRtcLocalAudioTrack(adapter.get(), capturer, NULL));
blink::WebMediaStreamSource audio_source;
- audio_source.initialize(base::UTF8ToUTF16("dummy_source_id"),
+ audio_source.initialize(blink::WebString::fromUTF8("dummy_source_id"),
blink::WebMediaStreamSource::TypeAudio,
- base::UTF8ToUTF16("dummy_source_name"),
+ blink::WebString::fromUTF8("dummy_source_name"),
false /* remote */, true /* readonly */);
+ audio_source.setExtraData(
+ new MediaStreamAudioSource(false /* is_remote */));
blink_track_.initialize(blink::WebString::fromUTF8("audio_track"),
audio_source);
- blink_track_.setExtraData(native_track.release());
+ ASSERT_TRUE(MediaStreamAudioSource::Get(audio_source)
+ ->ConnectToTrack(blink_track_));
}
DISALLOW_COPY_AND_ASSIGN(AudioTrackRecorderTest);
« no previous file with comments | « content/renderer/media/audio_track_recorder.cc ('k') | content/renderer/media/external_media_stream_audio_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698