Bug 1611320 [wpt PR 21400] - Gate Longtasks and PaintTiming tests under assert_precon...
[gecko.git] / testing / web-platform / tests / mediacapture-image / MediaStreamTrack-getCapabilities-fast.html
blob55272d1499517a6fda0b7e06068928b4e1127b27
1 <!DOCTYPE html>
2 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script>
4 <body>
5 <canvas id='canvas' width=10 height=10/>
6 </body>
7 <script>
9 // This test verifies that MediaStreamTrack.getCapabilities() exists and that it
10 // returns something. Other tests go deeper.
11 test(function() {
12 var canvas = document.getElementById('canvas');
13 var context = canvas.getContext("2d");
14 context.fillStyle = "red";
15 context.fillRect(0, 0, 10, 10);
17 var stream = canvas.captureStream();
18 assert_equals(stream.getAudioTracks().length, 0);
19 assert_equals(stream.getVideoTracks().length, 1);
21 var videoTrack = stream.getVideoTracks()[0];
23 assert_equals(typeof videoTrack.getCapabilities, 'function');
25 capabilities = videoTrack.getCapabilities();
26 assert_equals(typeof capabilities, 'object');
27 }, 'MediaStreamTrack.getCapabilities()');
29 </script>