Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <title>Test for autoplay of video once the media stream is set to null</title> | |
| 3 <script src="../resources/testharness.js"></script> | |
| 4 <script src="../resources/testharnessreport.js"></script> | |
| 5 <script src="media-file.js"></script> | |
| 6 <script> | |
| 7 test(function() { | |
| 8 assert_true(!!window.internals && !!window.internals.settings, | |
| 9 "This test only works when run as a layout test!"); | |
| 10 }, "Prerequisites to running the rest of the tests"); | |
| 11 window.internals.settings.setMediaPlaybackRequiresUserGesture(true); | |
| 12 async_test(function(t) { | |
|
mlamouri (slow - plz ping)
2016/06/27 12:28:09
Can you add some empty lines. Like separate the `t
whywhat
2016/06/27 14:50:16
Done.
| |
| 13 var v = document.createElement('video'); | |
| 14 v.srcObject = (new AudioContext()).createMediaStreamDestination().stream ; | |
| 15 setTimeout(t.step_func(function() { | |
| 16 v.srcObject = null; | |
| 17 v.src = findMediaFile('video', 'content/test'); | |
| 18 v.play() | |
| 19 .then(t.unreached_func('The video must not play without user gestu re.')) | |
| 20 .catch(t.step_func_done(function() { | |
| 21 assert_true(v.paused); | |
| 22 })); | |
| 23 }),0); | |
| 24 }, 'Test that switching from MediaStream to src= does not autoplay.'); | |
| 25 </script> | |
| OLD | NEW |