summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/mediacapture-streams/overconstrained_error.https.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/mediacapture-streams/overconstrained_error.https.html')
-rw-r--r--testing/web-platform/tests/mediacapture-streams/overconstrained_error.https.html29
1 files changed, 29 insertions, 0 deletions
diff --git a/testing/web-platform/tests/mediacapture-streams/overconstrained_error.https.html b/testing/web-platform/tests/mediacapture-streams/overconstrained_error.https.html
new file mode 100644
index 0000000000..abaff3b773
--- /dev/null
+++ b/testing/web-platform/tests/mediacapture-streams/overconstrained_error.https.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+</head>
+<body>
+<script>
+
+promise_test(async t => {
+ try {
+ stream = await navigator.mediaDevices.getUserMedia(
+ {video: {width: {exact: 639}, resizeMode: {exact: "none"}}});
+ t.add_cleanup(()=>stream.getVideoTracks()[0].stop());
+ t.step(() => assert_unreached('applyConstraints should have failed'));
+ } catch(e) {
+ assert_true(e instanceof DOMException);
+ assert_equals(e.name, 'OverconstrainedError');
+ assert_equals(e.constraint, 'width');
+ }
+}, 'Error of OverconstrainedError type inherit from DOMException');
+
+promise_test(async t => {
+ assert_true(new OverconstrainedError("constraint") instanceof DOMException);
+}, 'OverconstrainedError class inherits from DOMException');
+
+</script>
+</body>
+</html>