Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Side by Side Diff: LayoutTests/svg/as-image/animated-svg-as-image.html

Issue 1304093006: Add a new API for testing animated images (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Cleanup tests Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../fast/repaint/resources/text-based-repaint.js" type="text/ja vascript"></script> 3 <script src="../../fast/repaint/resources/text-based-repaint.js" type="text/ja vascript"></script>
4 <script type="text/javascript"> 4 <script type="text/javascript">
5 window.testIsAsync = true; 5 window.testIsAsync = true;
6 // These svg files are animated automatically, so have flaky repaint rect 6 // These svg files are animated automatically, so have flaky repaint rect
7 // output depending on when repaint rect capturing starts. 7 // output depending on when repaint rect capturing starts.
8 window.outputRepaintRects = false; 8 window.outputRepaintRects = false;
9 function repaintTest() { 9 function repaintTest() {
10 if (!window.testRunner) 10 if (!window.testRunner)
11 return; 11 return;
12 12
13 // The animation lasts 100ms. Wait 200ms for the repaint. 13 // The animation lasts 100ms so skip 12 frames to be sure.
fs 2015/09/08 14:50:57 Maybe mention the expected frame duration as well
pdr. 2015/09/08 22:50:37 Done. 12 was chosen to future proof us up to 120fp
14 setTimeout(function() { 14 for (var i = 0; i < 12; i++) {
15 window.internals.advanceImageAnimation(imageA);
16 window.internals.advanceImageAnimation(imageB);
17 }
18
19 window.requestAnimationFrame(function() {
15 finishRepaintTest(); 20 finishRepaintTest();
16 }, 200); 21 });
17 } 22 }
18 </script> 23 </script>
19 <style type="text/css" media="screen"> 24 <style type="text/css" media="screen">
20 img { 25 img {
21 margin: 10px; 26 margin: 10px;
22 } 27 }
23 </style> 28 </style>
24 </head> 29 </head>
25 <body onload="runRepaintAndPixelTest()"> 30 <body onload="runRepaintAndPixelTest()">
26 <p>Images should redraw correctly when SVG animation runs</p> 31 <p>Images should redraw correctly when SVG animation runs</p>
27 <!-- Don't load animated-rect-fixed-size.svg, it will already be loaded, and t he animation already ran if animated-svg-as-image-no-fixed-intrinsic-size.html r uns before this test! --> 32 <!-- Don't load animated-rect-fixed-size.svg, it will already be loaded, and t he animation already ran if animated-svg-as-image-no-fixed-intrinsic-size.html r uns before this test! -->
28 <img height="250px" width="350px" border="2" src="resources/animated-rect-fixe d-size-2.svg"><br> 33 <img id="imageA" height="250px" width="350px" border="2" src="resources/animat ed-rect-fixed-size-2.svg"><br>
29 <!-- animated-rect-relative-size.svg is not loaded by any other test, so there 's no problem here --> 34 <!-- animated-rect-relative-size.svg is not loaded by any other test, so there 's no problem here -->
30 <img height="250px" width="350px" border="2" src="resources/animated-rect-rela tive-size.svg"> 35 <img id="imageB" height="250px" width="350px" border="2" src="resources/animat ed-rect-relative-size.svg">
31 </body> 36 </body>
32 </html> 37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698