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

Side by Side Diff: LayoutTests/canvas/philip/tests/2d.drawImage.animated.gif.html

Issue 1304093006: Add a new API for testing animated images (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase harder 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Canvas test: 2d.drawImage.animated.gif</title> 2 <title>Canvas test: 2d.drawImage.animated.gif</title>
3 <script src="../tests.js"></script> 3 <script src="../tests.js"></script>
4 <link rel="stylesheet" href="../tests.css"> 4 <link rel="stylesheet" href="../tests.css">
5 <body> 5 <body>
6 <p id="passtext">Pass</p> 6 <p id="passtext">Pass</p>
7 <p id="failtext">Fail</p> 7 <p id="failtext">Fail</p>
8 <p class="output">These images should be identical:</p> 8 <p class="output">These images should be identical:</p>
9 <canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL ( fallback content)</p></canvas> 9 <canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL ( fallback content)</p></canvas>
10 <p class="output expectedtext">Expected output:<p><img src="green-100x50.png" cl ass="output expected" id="expected" alt=""> 10 <p class="output expectedtext">Expected output:<p><img src="green-100x50.png" cl ass="output expected" id="expected" alt="">
11 <ul id="d"></ul> 11 <ul id="d"></ul>
12 <script> 12 <script>
13 _addTest(function(canvas, ctx) { 13 _addTest(function(canvas, ctx) {
14 14
15 deferTest(); 15 deferTest();
16 setTimeout(wrapFunction(function () { 16
17 // Advance the animation one frame to ensure we only draw the first frame.
18 window.internals.advanceImageAnimation(document.getElementById('anim-gr.gif'));
19
20 requestAnimationFrame(wrapFunction(function () {
17 ctx.drawImage(document.getElementById('anim-gr.gif'), 0, 0); 21 ctx.drawImage(document.getElementById('anim-gr.gif'), 0, 0);
18 _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); 22 _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
19 }), 500); 23 }));
20
21 24
22 }); 25 });
23 </script> 26 </script>
24 <img src="../images/anim-gr.gif" id="anim-gr.gif" class="resource"> 27 <img src="../images/anim-gr.gif" id="anim-gr.gif" class="resource">
25 28
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/canvas/canvas-createImageBitmap-animated.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698