twilio / rtc-diagnostics

Other
46 stars 14 forks source link

[CLIENT-7235] Add option validation for audio device tests and use new `timing` types. #12

Closed mhuynh5757 closed 4 years ago

mhuynh5757 commented 4 years ago

This PR includes commits that have already been improved by @charliesantos . All commits past the commit titled Change default of `OutputTest.stop(pass)` to `pass = true`. with hash 1e8b4f9 need to be reviewed.

This PR implements an OptionValidator utility to verify that options passed to the audio device tests are valid.

Contributing to Twilio

All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.

mhuynh5757 commented 4 years ago

The diff that needs to approved is the following range of commits: https://github.com/twilio/sdk-diagnostics/pull/12/files/1e8b4f98d3b3c8d683501f48d3fa18e568ccc2c0..1dd6d8a93fbeafc6de9544feaf7d3a82fc392c6a

mhuynh5757 commented 4 years ago

Some discussion on https://github.com/twilio/sdk-diagnostics/pull/12/files#diff-632870ac3cbe136c6e8215ce5b4953c5R60.

This method of validating a deviceId seems heavy handed, and is replaced with the validator validateDeviceId, which simply checks that if the deviceId is defined, then it must be a string. Then, when an invalid deviceId that passes that validator is given to setSinkId or getUserMedia, then that will throw and be handled.