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

Side by Side Diff: third_party/WebKit/LayoutTests/canvas/synchronous-create-pattern.html

Issue 1493883002: Add layout test canvas/synchronous-create-pattern.html back (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better testing Created 5 years 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
(Empty)
1 <!DOCTYPE HTML>
2 <html>
3 <script>
4 var canvas, context, pattern, image;
5
6 function runTest() {
7 if (window.testRunner)
8 testRunner.waitUntilDone();
9
10 canvas = document.getElementById('canvas');
11 context = canvas.getContext('2d');
12
13 // Initialize the canvas with orange.
14 context.fillStyle = '#FFA500';
15 context.fillRect(0, 0, 100, 100);
16
17 image = document.getElementById('image');
18 image.setAttribute('src', 'resources/green-flash-at-50ms.svg');
19 image.onload = function() {
20 pattern = context.createPattern(image, 'repeat');
21 setTimeout(function() { drawPatternAndFinish(); }, 55);
22 }
23 }
24
25 function drawPatternAndFinish() {
26 // Advance the image one more time to the last frame.
27 // The pattern should not be affected.
28 window.internals.advanceImageAnimation(image);
29
30 context.fillStyle = pattern;
31 context.fillRect(0, 0, 200, 200);
32
33 if (window.testRunner)
34 testRunner.notifyDone();
35 }
36
37 </script>
38 <body onload='runTest()'>
39 Test for crbug.com/279445: createPattern should synchronously snapshot an an imating image.<br/>
40 This test passes if there is a blue square below:<br/>
41 <canvas id='canvas' width='100' height='100'></canvas><br/>
42 And a green square below:<br/>
43 <img id='image' width='100' height='100'>
44 </body>
45 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698