currentTime-move-within-document.html (981B)
1 <!doctype html> 2 <title>playback should not reset when moving within a document</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="/common/media.js"></script> 6 <div id="log"></div> 7 <video autoplay muted hidden></video> 8 <div id="elsewhere"></div> 9 <script> 10 async_test(t => { 11 const v = document.querySelector('video'); 12 v.src = getVideoURI('/media/movie_300'); 13 v.currentTime = 0; 14 v.onplaying = t.step_func(() => { 15 v.currentTime = 10; 16 t.step_timeout(() => { 17 assert_greater_than_equal(v.currentTime, 10); 18 document.getElementById('elsewhere').appendChild(v); 19 assert_false(v.paused, 'paused after moving'); 20 assert_greater_than_equal(v.currentTime, 10); 21 t.step_timeout(() => { 22 assert_greater_than_equal(v.currentTime, 10); 23 t.done(); 24 }, 0); 25 }, 0); 26 27 }); 28 v.play(); 29 v.onpause = t.step_func(function() { assert_unreached(); }); 30 }); 31 </script>