| <!doctype html> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <title>getDisplayMedia track support of max constraints</title> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| <script src="resources/getDisplayMedia-utils.js"></script> |
| </head> |
| <body> |
| <script> |
| let defaultWidth; |
| let defaultHeight; |
| promise_test(async () => { |
| stream = await callGetDisplayMedia({ video: true }); |
| let settings = stream.getVideoTracks()[0].getSettings(); |
| defaultWidth = settings.width; |
| defaultHeight = settings.height; |
| }, "setup"); |
| |
| promise_test(async (test) => { |
| const stream = await callGetDisplayMedia({ video: { height: { max: 500000 }, width : { max : 500000 } } }); |
| assert_equals(stream.getVideoTracks()[0].getConstraints().height.max, 500000); |
| assert_equals(stream.getVideoTracks()[0].getConstraints().width.max, 500000); |
| |
| await waitForHeight(stream.getVideoTracks()[0], defaultHeight); |
| |
| const settings = stream.getVideoTracks()[0].getSettings() |
| assert_equals(settings.width, defaultWidth); |
| }, "No effect of the max values if they are too big"); |
| </script> |
| </body> |
| </html> |