MediaStreamTrack.getSettings should compute its deviceId/groupId like enumerateDevices
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Sep 2017 21:46:46 +0000 (21:46 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Sep 2017 21:46:46 +0000 (21:46 +0000)
commit11cea334517e2ab222cce2ad6402edf49e8b807e
tree987487379f1f991a4c969f17e7cf3e979df8486c
parentaf0a7064f6317c3bdea7dab3a962fbecdbed4338
MediaStreamTrack.getSettings should compute its deviceId/groupId like enumerateDevices
https://bugs.webkit.org/show_bug.cgi?id=177433

Patch by Youenn Fablet <youenn@apple.com> on 2017-09-25
Reviewed by Jer Noble.

Source/WebCore:

Covered by improved test.

Hash the deviceId returned by getSettings as done by enumerateDevices/getUserMedia.
Do the same thing for groupId.
Make sure mock sources have their deviceId set consistently with mock devices.

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::getSettings const):
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSource::create):
(WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac):
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSource::create):
(WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac):
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::create):
(WebCore::MockRealtimeAudioSource::createMuted):
(WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource):
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::create):
(WebCore::MockRealtimeVideoSource::createMuted):
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
* platform/mock/MockRealtimeVideoSource.h:

LayoutTests:

* fast/mediastream/get-user-media-device-id.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/mediastream/get-user-media-device-id.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.h
Source/WebCore/Modules/mediastream/MediaStreamTrack.idl
Source/WebCore/platform/mediastream/mac/MockRealtimeAudioSourceMac.h
Source/WebCore/platform/mediastream/mac/MockRealtimeAudioSourceMac.mm
Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.h
Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm
Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp
Source/WebCore/platform/mock/MockRealtimeAudioSource.h
Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
Source/WebCore/platform/mock/MockRealtimeVideoSource.h