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

Side by Side Diff: LayoutTests/compositing/webgl/webgl-repaint.html

Issue 196353013: Convert some repaint tests to not call display() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More expectations, remove do-not-repaint tricky test Created 6 years, 9 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/css3/flexbox/repaint.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <style type="text/css" media="screen"> 4 <style type="text/css" media="screen">
5 canvas { 5 canvas {
6 margin: 20px; 6 margin: 20px;
7 width: 200px; 7 width: 200px;
8 height: 200px; 8 height: 200px;
9 padding: 0 0; 9 padding: 0 0;
10 } 10 }
11 .border { 11 .border {
12 border: 1px solid black; 12 border: 1px solid black;
13 } 13 }
14 </style> 14 </style>
15 <script src="../../resources/run-after-display.js"></script>
15 <script> 16 <script>
16 if (window.testRunner) 17 if (window.testRunner)
17 testRunner.overridePreference("WebKitWebGLEnabled", "1"); 18 testRunner.overridePreference("WebKitWebGLEnabled", "1");
18 19
19 function initWebGL() 20 function initWebGL()
20 { 21 {
21 var canvas = document.getElementById('canvas'); 22 var canvas = document.getElementById('canvas');
22 var gl = canvas.getContext("experimental-webgl", {'antialias': false}); 23 var gl = canvas.getContext("experimental-webgl", {'antialias': false});
23 if (!gl) { 24 if (!gl) {
24 alert("No WebGL context found"); 25 alert("No WebGL context found");
25 return null; 26 return null;
26 } 27 }
27 28
28 return gl; 29 return gl;
29 } 30 }
30 31
31 var gl = null; 32 var gl = null;
32 33
33 function init() 34 function init()
34 { 35 {
35 gl = initWebGL(); 36 gl = initWebGL();
36 gl.viewport(0, 0, 200, 200); 37 gl.viewport(0, 0, 200, 200);
37 gl.clearColor(1, 0, 0, 1); // red 38 gl.clearColor(1, 0, 0, 1); // red
38 gl.clear(gl.COLOR_BUFFER_BIT); 39 gl.clear(gl.COLOR_BUFFER_BIT);
39 if (window.testRunner) { 40 if (window.testRunner) {
40 testRunner.display(); 41 testRunner.waitUntilDone();
41 testRunner.dumpAsTextWithPixelResults(); 42 testRunner.dumpAsTextWithPixelResults();
42 drawGreen(); 43 }
43 } else 44 runAfterDisplay(drawGreen);
44 window.setTimeout(drawGreen, 50);
45 } 45 }
46 46
47 function drawGreen() 47 function drawGreen()
48 { 48 {
49 gl.clearColor(0, 1, 0, 1); // green 49 gl.clearColor(0, 1, 0, 1); // green
50 gl.clear(gl.COLOR_BUFFER_BIT); 50 gl.clear(gl.COLOR_BUFFER_BIT);
51 if (window.testRunner) { 51 if (window.testRunner) {
52 testRunner.display(); 52 testRunner.notifyDone();
53 testRunner.display();
54 } else 53 } else
55 window.setInterval(function() { 54 window.setInterval(function() {
56 document.getElementById('canvas').classList.toggle('border'); 55 document.getElementById('canvas').classList.toggle('border');
57 }, 50); 56 }, 50);
58 } 57 }
59 58
60 </script> 59 </script>
61 </head> 60 </head>
62 <body onload="init()"> 61 <body onload="init()">
63 <canvas id="canvas" width="200" height="200"></canvas> 62 <canvas id="canvas" width="200" height="200"></canvas>
64 </body> 63 </body>
65 </html> 64 </html>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/css3/flexbox/repaint.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698