Bug 169870

Summary: [MediaStream] Respect constraints passed to getUserMedia
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: ASSIGNED ---    
Severity: Normal CC: commit-queue, jer.noble, jonlee, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch.
none
Patch for landing. none

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>