Bug 169870 - [MediaStream] Respect constraints passed to getUserMedia
Summary: [MediaStream] Respect constraints passed to getUserMedia
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media Elements (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-03-19 18:44 PDT by Eric Carlson
Modified: 2017-03-20 10:55 PDT (History)
5 users (show)

See Also:


Attachments
Proposed patch. (37.45 KB, patch)
2017-03-19 19:03 PDT, Eric Carlson
youennf: review+
Details | Formatted Diff | Diff
Patch for landing. (38.12 KB, patch)
2017-03-20 10:12 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2017-03-19 18:44:01 PDT
The fitness score calculated for constraints passed to getUserMedia is not used when selecting between multiple devices.
Comment 1 Radar WebKit Bug Importer 2017-03-19 18:45:10 PDT
<rdar://problem/31138936>
Comment 2 Eric Carlson 2017-03-19 19:03:12 PDT
Created attachment 304910 [details]
Proposed patch.
Comment 3 Jer Noble 2017-03-20 09:56:40 PDT
Comment on attachment 304910 [details]
Proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=304910&action=review

> LayoutTests/fast/mediastream/MediaDevices-enumerateDevices-expected.txt:31
> +FAIL deviceIds.indexOf(captureDevice.deviceId) should not be -1.

Is this an expected failure?

> LayoutTests/fast/mediastream/MediaDevices-enumerateDevices-expected.txt:38
> +FAIL deviceIds.indexOf(captureDevice.deviceId) should not be -1.

Ditto

> LayoutTests/fast/mediastream/MediaDevices-enumerateDevices-expected.txt:64
> +FAIL deviceIds.indexOf(captureDevice.deviceId) should not be -1.

Ditto

> LayoutTests/fast/mediastream/MediaDevices-enumerateDevices-expected.txt:71
> +FAIL deviceIds.indexOf(captureDevice.deviceId) should not be -1.

Ditto

> LayoutTests/fast/mediastream/MediaDevices-enumerateDevices-expected.txt:97
> +FAIL deviceIds.indexOf(captureDevice.deviceId) should not be -1.

Ditto

> LayoutTests/fast/mediastream/MediaDevices-enumerateDevices-expected.txt:104
> +FAIL deviceIds.indexOf(captureDevice.deviceId) should not be -1.

Ditto. 

If so, we should come up with a way of reporting it as a "PASS, failed expectedly."
Comment 4 Eric Carlson 2017-03-20 10:03:13 PDT
Comment on attachment 304910 [details]
Proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=304910&action=review

>> LayoutTests/fast/mediastream/MediaDevices-enumerateDevices-expected.txt:104
>> +FAIL deviceIds.indexOf(captureDevice.deviceId) should not be -1.
> 
> Ditto. 
> 
> If so, we should come up with a way of reporting it as a "PASS, failed expectedly."

Oops, I need to update the test and results now that there are four mock devices. Good catch!
Comment 5 Eric Carlson 2017-03-20 10:12:38 PDT
Created attachment 304929 [details]
Patch for landing.
Comment 6 WebKit Commit Bot 2017-03-20 10:55:24 PDT
Comment on attachment 304929 [details]
Patch for landing.

Clearing flags on attachment: 304929

Committed r214178: <http://trac.webkit.org/changeset/214178>