Bug 802326 - test that getUserMedia fails w/required video constraint, regardless of audio.
MozReview-Commit-ID: DtvgDGIiZaN
--- a/dom/media/tests/mochitest/test_getUserMedia_constraints.html
+++ b/dom/media/tests/mochitest/test_getUserMedia_constraints.html
@@ -130,14 +130,21 @@ runTest(function() {
.then(() => stream.getAudioTracks()[0].applyConstraints({ })))
.then(() => ok(true, "applyConstraints code exercised"))
// TODO: Test outcome once fake devices support constraints (Bug 1088621)
.then(() => mustFailWith("applyConstraints fails on non-Gum tracks",
"OverconstrainedError", "",
() => (new AudioContext())
.createMediaStreamDestination().stream
.getAudioTracks()[0].applyConstraints()))
+ .then(() => mustFailWith(
+ "getUserMedia with unsatisfied required constraint",
+ "OverconstrainedError", "deviceId",
+ () => navigator.mediaDevices.getUserMedia({
+ audio: true,
+ video: { deviceId: { exact: "unheardof" } },
+ })));
});
</script>
</pre>
</body>
</html>