Bug 160791

Summary: Add tests for parsing of Media Constraints in getUserMedia()
Product: WebKit Reporter: George Ruan <gruan>
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: jonlee, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=146746

Description George Ruan 2016-08-11 17:36:10 PDT
Currently there is only limited testing on the parsing of mandatory constraints in getUserMedia.

Full testing can be made possible after implementation of getSettings(): https://w3c.github.io/mediacapture-main/#dom-mediastreamtrack-getsettings.
Comment 1 Radar WebKit Bug Importer 2016-08-11 17:37:28 PDT
<rdar://problem/27815747>
Comment 2 George Ruan 2016-08-11 17:41:02 PDT
(In reply to comment #0)
> Currently there is only limited testing on the parsing of mandatory
> constraints in getUserMedia.
> 
> Full testing can be made possible after implementation of getSettings():
> https://w3c.github.io/mediacapture-main/#dom-mediastreamtrack-getsettings.

I mispoke. getSettings() is already implemented. Full testing is possible after there is support for a media stream track being able to set its settings according to the constraints passed through to getUserMedia.
Comment 3 George Ruan 2016-08-11 18:47:03 PDT
Some tests that come to mind include:
- Checking that arbitrary constraints are ignored.
- Checking that supported constraints with empty scalar value are ignored.
- Checking that supported constraints with empty dictionary values are ignored.
- Checking that supported string constraints with empty array values are ignored.

- Checking that advanced constraints with scalar values are treated as 'exact' values
- Checking that mandatory constraints with scalar values are treated as 'ideal' values

- Checking that boolean, double, and long constraints can accept only scalar and dictionary values.
- Checking that string constraints can handle sequences, scalar, and dictionary values
- Checking that string dictionary constraint values can handle both scalars and sequences for the 'exact' and 'ideal' key.