test_canvas_frame_animation.html (1327B)
1 <!doctype html> 2 <title>Test for bug 1619245 - animated image as canvas background</title> 3 <script src="/tests/SimpleTest/SimpleTest.js"></script> 4 <script src="/tests/SimpleTest/WindowSnapshot.js"></script> 5 <script src="imgutils.js"></script> 6 <script src="animationPolling.js"></script> 7 <!-- Intentionally not including SimpleTest.css as that sets the background of the root --> 8 <body id="body" style="background-image: url(animated-gif.gif); display: none; overflow: hidden;"> 9 <div id="reference" style="background-image: url(animated-gif-finalframe.gif); display: none; width: 100vw; height: 100vh;"></div> 10 <div id="clean" style="display: none; width: 100vw; height: 100vh;"></div> 11 <div id="debug" style="display: none"></div> 12 </body> 13 <script> 14 const FAILURE_TIMEOUT = 120000; // Fail early after 120 seconds (2 minutes) 15 16 window.onload = function() { 17 // first move the reference outside of the <body>, so that the test can properly show it. 18 document.documentElement.appendChild(document.getElementById("reference")); 19 document.documentElement.appendChild(document.getElementById("debug")); 20 document.documentElement.appendChild(document.getElementById("clean")); 21 var animTest = new AnimationTest(20, FAILURE_TIMEOUT, 'reference', 'body', 'debug', 'clean', 'animated-gif.gif'); 22 animTest.beginTest(); 23 } 24 </script>