Index: components/test_runner/mock_web_user_media_client.cc |
diff --git a/components/test_runner/mock_web_user_media_client.cc b/components/test_runner/mock_web_user_media_client.cc |
index f30fac9924beb9f87cb5df90cdd323c0e7a15871..4c0d235f744a7b0b764a921722b5de875ec00c46 100644 |
--- a/components/test_runner/mock_web_user_media_client.cc |
+++ b/components/test_runner/mock_web_user_media_client.cc |
@@ -7,6 +7,7 @@ |
#include "base/logging.h" |
#include "base/macros.h" |
#include "components/test_runner/mock_constraints.h" |
+#include "components/test_runner/renderer/mock_video_capturer_source.h" |
#include "components/test_runner/web_test_delegate.h" |
#include "third_party/WebKit/public/platform/WebMediaConstraints.h" |
#include "third_party/WebKit/public/platform/WebMediaDeviceInfo.h" |
@@ -18,7 +19,6 @@ |
#include "third_party/WebKit/public/platform/WebVector.h" |
#include "third_party/WebKit/public/web/WebDocument.h" |
#include "third_party/WebKit/public/web/WebMediaDevicesRequest.h" |
-#include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" |
#include "third_party/WebKit/public/web/WebUserMediaRequest.h" |
using blink::WebMediaConstraints; |
@@ -126,7 +126,7 @@ class SourcesRequestTask : public WebMethodTask<MockWebUserMediaClient> { |
DISALLOW_COPY_AND_ASSIGN(SourcesRequestTask); |
}; |
-class MockExtraData : public WebMediaStream::ExtraData { |
+class MockStreamExtraData : public WebMediaStream::ExtraData { |
public: |
int foo; |
}; |
@@ -164,8 +164,6 @@ void MockWebUserMediaClient::requestUserMedia( |
const size_t zero = 0; |
const size_t one = 1; |
WebVector<WebMediaStreamTrack> audio_tracks(request.audio() ? one : zero); |
- WebVector<WebMediaStreamTrack> video_tracks(request.video() ? one : zero); |
- |
if (request.audio()) { |
WebMediaStreamSource source; |
source.initialize("MockAudioDevice#1", |
@@ -175,19 +173,18 @@ void MockWebUserMediaClient::requestUserMedia( |
audio_tracks[0].initialize(source); |
} |
- if (request.video()) { |
- WebMediaStreamSource source; |
- source.initialize("MockVideoDevice#1", |
- WebMediaStreamSource::TypeVideo, |
- "Mock video device", |
- false /* remote */, true /* readonly */); |
- video_tracks[0].initialize(source); |
- } |
- |
WebMediaStream stream; |
- stream.initialize(audio_tracks, video_tracks); |
+ const WebVector<WebMediaStreamTrack> empty_track_vector; |
+ stream.initialize(audio_tracks, empty_track_vector); |
+ stream.setExtraData(new MockStreamExtraData()); |
- stream.setExtraData(new MockExtraData()); |
+ if (request.video()) { |
+ content::AddVideoTrackToMediaStream( |
+ make_scoped_ptr(new MockVideoCapturerSource()), |
+ false /*is _remote */, |
+ true /* is_readonly */, |
+ &stream); |
+ } |
delegate_->PostTask(new UserMediaRequestTask(this, request, stream)); |
} |
@@ -231,7 +228,6 @@ void MockWebUserMediaClient::requestMediaDevices( |
WebString::fromUTF8(test_devices[i].label), |
WebString::fromUTF8(test_devices[i].group_id)); |
} |
- |
delegate_->PostTask(new MediaDevicesRequestTask(this, request, devices)); |
} |