| <title>OverConstrainedError.constraint testing</title> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| testRunner.setUserMediaPermission(true); |
| window.internals.setMockMediaCaptureDevicesEnabled(true); |
| promise_test(async () => { |
| return navigator.mediaDevices.getUserMedia({audio: {deviceId: {exact:"none"}}}).then( |
| () => assert_not_reached("gum should fail"), |
| assert_true(e instanceof OverconstrainedError); |
| assert_equals(e.constraint, "", "constraint should be the empty string"); |
| promise_test(async(test) => { |
| await navigator.mediaDevices.getUserMedia({audio: true}); |
| return navigator.mediaDevices.getUserMedia({audio: {deviceId: {exact:"none"}}}).then( |
| () => assert_not_reached("gum should fail"), |
| assert_true(e instanceof OverconstrainedError); |
| assert_equals(e.constraint, "deviceId", "constraint should be deviceId"); |