| <!DOCTYPE html> |
| <script src=../../resources/testharness.js></script> |
| <script src=../../resources/testharnessreport.js></script> |
| <script> |
| // This test verifies that MediaStream can be created with captureStream() call. |
| test(function() { |
| var canvas = document.createElement('canvas'); |
| var stream = canvas.captureStream(); |
| assert_not_equals(stream, null); |
| assert_equals(stream.active, true); |
| assert_equals(stream.getVideoTracks().length, 1); |
| assert_equals(stream.getAudioTracks().length, 0); |
| var track = stream.getVideoTracks()[0]; |
| assert_equals(track.readyState, 'live'); |
| assert_equals(track.enabled, true); |
| assert_equals(track.muted, false); |
| var cloned_track = track.clone(); |
| assert_equals(track.readyState, 'live'); |
| assert_equals(track.enabled, true); |
| assert_equals(track.muted, false); |
| assert_equals(cloned_track.readyState, 'live'); |
| assert_equals(cloned_track.enabled, true); |
| assert_equals(cloned_track.muted, false); |
| track.stop(); |
| assert_equals(cloned_track.enabled, true); |
| var canvas = cloned_track.canvas; |
| assert_not_equals(stream, null); |
| cloned_track.requestFrame(); |
| }, 'check clone track after captureStream()'); |
| |
| </script> |