Skip to content

Commit

Permalink
Bug 1667339 [wpt PR 25785] - [PTZ] Deny mandatory PTZ constraints in …
Browse files Browse the repository at this point in the history
…basic getUserMedia constraints, a=testonly

Automatic update from web-platform-tests
[PTZ] Deny mandatory PTZ constraints in basic getUserMedia constraints

This PR makes sure required PTZ constraints in the basic constraint set
are denied (and throw a TypeError) and PTZ capability constraints
({ zoom: true } etc.) are ideal in the basic constraint set.
Therefore, a PTZ constraint in the basic set cannot cause getUserMedia()
to fail conditionally.

Spec:
w3c/mediacapture-image#261
w3c/mediacapture-main#707

Bug: 934063
Change-Id: I7324ae32b064dbf3b89325166834e2694eca593b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411946
Commit-Queue: François Beaufort <[email protected]>
Reviewed-by: Eero Häkkinen <[email protected]>
Reviewed-by: Philip Jägenstedt <[email protected]>
Reviewed-by: Guido Urdaneta <[email protected]>
Reviewed-by: Reilly Grant <[email protected]>
Cr-Commit-Position: refs/heads/master@{#811242}

--

wpt-commits: dcb7fbd8b1c1223fcc72819cf1c66ac2c03b04c8
wpt-pr: 25785
  • Loading branch information
beaufortfrancois authored and moz-wptsync-bot committed Oct 3, 2020
1 parent 609901a commit 5a076f0
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!doctype html>
<meta charset=utf-8>
<title>getUserMedia</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";

[
{ video: { pan: { min: 1 } } },
{ video: { pan: { max: 1 } } },
{ video: { pan: { exact: 1 } } },
{ video: { tilt: { min: 1 } } },
{ video: { tilt: { max: 1 } } },
{ video: { tilt: { exact: 1 } } },
{ video: { zoom: { min: 1 } } },
{ video: { zoom: { max: 1 } } },
{ video: { zoom: { exact: 1 } } }
].forEach(constraints =>
promise_test(t => {
const promise = navigator.mediaDevices.getUserMedia(constraints);
return promise_rejects_js(t, TypeError, promise);
}, `getUserMedia(${JSON.stringify(constraints)}) must fail with TypeError`)
);

</script>

0 comments on commit 5a076f0

Please sign in to comment.