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

Side by Side Diff: LayoutTests/paint/invalidation/spv2/canvas-resize.html

Issue 1302183007: Convert some text-based-repaint tests for spv2 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
OLDNEW
1 <!-- Based on fast/repaint/canvas-resize.html -->
1 <!DOCTYPE html> 2 <!DOCTYPE html>
2 <style> 3 <style>
3 canvas { 4 canvas {
4 position: absolute; 5 position: absolute;
5 width: 600px; 6 width: 600px;
6 height: 500px; 7 height: 500px;
7 top: 50px; 8 top: 50px;
8 left: 50px; 9 left: 50px;
9 } 10 }
10 </style> 11 </style>
11 Tests paint invalidation of canvas when it's resized. Passes if there is a whole green circle. 12 Tests paint invalidation of canvas when it's resized. Passes if there is a whole green circle.
12 <canvas id="canvas" width="500" height="500"></canvas> 13 <canvas id="canvas" width="500" height="500"></canvas>
13 14
14 <script src="resources/text-based-repaint.js"></script> 15 <script src="resources/paint-invalidation-test.js"></script>
15 <script> 16 <script>
16 function repaintTest() { 17 window.expectedPaintInvalidationObjects = [
18 "LayoutHTMLCanvas (positioned) CANVAS id='canvas'",
19 ];
20 function paintInvalidationTest() {
17 document.getElementById('canvas').style.width = '500px'; 21 document.getElementById('canvas').style.width = '500px';
18 } 22 }
19 onload = runRepaintTest; 23 onload = runPaintInvalidationTest;
20 24
21 var ctx = document.getElementById('canvas').getContext('2d'); 25 var ctx = document.getElementById('canvas').getContext('2d');
22 ctx.beginPath(); 26 ctx.beginPath();
23 ctx.arc(250, 250, 250, 0, 2 * Math.PI); 27 ctx.arc(250, 250, 250, 0, 2 * Math.PI);
24 ctx.fillStyle = 'green'; 28 ctx.fillStyle = 'green';
25 ctx.fill(); 29 ctx.fill();
26 </script> 30 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698