1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/reftests/webm-video/poster-12.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,40 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html class="reftest-wait"> 1.6 +<!-- Test: Create video, load, play. Add poster frame, load again, poster should show. --> 1.7 +<script> 1.8 +function runTest() { 1.9 + var v = document.createElement('video'); 1.10 + 1.11 + var endTest = function() { 1.12 + setTimeout(function(){document.documentElement.className = '';}, 0); 1.13 + }; 1.14 + 1.15 + var play = 1.16 + function() { 1.17 + v.removeEventListener('loadeddata', play, false); 1.18 + v.play(); 1.19 + } 1.20 + 1.21 + var addPoster = function() { 1.22 + v.removeEventListener('playing', addPoster,false); 1.23 + v.poster = "blue140x100.png"; 1.24 + v.addEventListener('loadeddata', endTest, false); 1.25 + v.load(); 1.26 + }; 1.27 + 1.28 + v.addEventListener('loadeddata', 1.29 + play, 1.30 + false); 1.31 + v.addEventListener('playing', 1.32 + addPoster, 1.33 + false); 1.34 + v.id = 'v'; 1.35 + v.src = "black140x100.webm"; 1.36 + v.preload = "auto"; 1.37 + document.body.appendChild(v); 1.38 +} 1.39 + 1.40 +</script> 1.41 +<body style="background:white;" onload="runTest();"> 1.42 +</body> 1.43 +</html>