Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/imagecapture/MediaStreamTrack-getCapabilities.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/imagecapture/MediaStreamTrack-getCapabilities.html b/third_party/WebKit/LayoutTests/fast/imagecapture/MediaStreamTrack-getCapabilities.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6b59779ea3abcdbfd93d19b2af63656df5d0a2bb |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/imagecapture/MediaStreamTrack-getCapabilities.html |
| @@ -0,0 +1,31 @@ |
| +<!DOCTYPE html> |
| +<script src=../../resources/testharness.js></script> |
| +<script src=../../resources/testharnessreport.js></script> |
| +<body> |
| +<canvas id='canvas' width=10 height=10/> |
| +</body> |
| +<script> |
| + |
| +// This test verifies that MediaStreamTrack.getCapabilities() exists and that it |
| +// 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.
|
| +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
|
| + var canvas = document.getElementById('canvas'); |
| + var context = canvas.getContext("2d"); |
| + context.fillStyle = "red"; |
| + context.fillRect(0, 0, 10, 10); |
| + |
| + var stream = canvas.captureStream(); |
| + assert_equals(stream.getAudioTracks().length, 0); |
| + assert_equals(stream.getVideoTracks().length, 1); |
| + |
| + var videoTrack = stream.getVideoTracks()[0]; |
| + |
| + assert_equals(typeof videoTrack.getCapabilities, 'function'); |
| + |
| + capabilities = videoTrack.getCapabilities(); |
| + assert_equals(typeof capabilities, 'object'); |
| + |
| + test.done(); |
| +}, 'MediaStreamTrack.getCapabilities()'); |
| + |
| +</script> |