Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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> | |
| 8 | |
| 9 // This test verifies that MediaStreamTrack.getCapabilities() exists and that it | |
| 10 // returns something. (Other tests go deeper). | |
|
Reilly Grant (use Gerrit)
2017/03/14 21:38:57
No parens.
mcasas
2017/03/14 22:28:01
Done.
| |
| 11 async_test(function(test) { | |
|
Reilly Grant (use Gerrit)
2017/03/14 21:38:57
Why not a synchronous test?
mcasas
2017/03/14 22:28:01
No reason, removed.
(Actually it was so because o
| |
| 12 var canvas = document.getElementById('canvas'); | |
| 13 var context = canvas.getContext("2d"); | |
| 14 context.fillStyle = "red"; | |
| 15 context.fillRect(0, 0, 10, 10); | |
| 16 | |
| 17 var stream = canvas.captureStream(); | |
| 18 assert_equals(stream.getAudioTracks().length, 0); | |
| 19 assert_equals(stream.getVideoTracks().length, 1); | |
| 20 | |
| 21 var videoTrack = stream.getVideoTracks()[0]; | |
| 22 | |
| 23 assert_equals(typeof videoTrack.getCapabilities, 'function'); | |
| 24 | |
| 25 capabilities = videoTrack.getCapabilities(); | |
| 26 assert_equals(typeof capabilities, 'object'); | |
| 27 | |
| 28 test.done(); | |
| 29 }, 'MediaStreamTrack.getCapabilities()'); | |
| 30 | |
| 31 </script> | |
| OLD | NEW |