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

Side by Side Diff: chrome/test/data/gpu/feature_webgl.html

Issue 8692013: Improve GPU tests to fail when GPU drawing fails (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-added DLOG Created 9 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3 <head> 3 <head>
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <title>GPU Feature Testing: WebGL</title> 5 <title>GPU Feature Testing: WebGL</title>
6 <script> 6 <script>
7 var frameCount = 0;
8 var gl = null;
9
7 function init() { 10 function init() {
8 var canvas = document.createElement("canvas"); 11 var canvas = document.getElementById("da-canvas");
9 if (!canvas) 12 if (!canvas)
10 return null; 13 return;
11 var context = null;
12 try { 14 try {
13 context = canvas.getContext("webgl"); 15 gl = canvas.getContext("webgl");
14 } catch(e) {} 16 } catch(e) {}
15 if (!context) { 17 if (!gl) {
16 try { 18 try {
17 context = canvas.getContext("experimental-webgl"); 19 gl = canvas.getContext("experimental-webgl");
18 } catch(e) {} 20 } catch(e) {}
19 } 21 }
20 return context;
21 } 22 }
22 23
23 function runTest() { 24 function runTest() {
24 var gl = init(); 25 init();
26 if (gl)
27 window.webkitRequestAnimationFrame(draw);
28 else
29 endTest();
30 }
31
32 function draw() {
33 frameCount++;
34 gl.viewport(0, 0, 500, 500);
35 gl.clearColor(1.0/frameCount, 0.0, 0.0, 1.0);
36 gl.clear(gl.COLOR_BUFFER_BIT);
37 if (frameCount == 5) {
38 endTest();
39 } else {
40 window.webkitRequestAnimationFrame(draw);
41 }
42 }
43
44 function endTest() {
25 domAutomationController.setAutomationId(1); 45 domAutomationController.setAutomationId(1);
26 domAutomationController.send("FINISHED"); 46 domAutomationController.send("FINISHED");
27 } 47 }
28 </script> 48 </script>
29 </head> 49 </head>
30 <body onload="runTest()"> 50 <body onload="runTest()">
31 WebGL should trigger GPU process launch if it is allowed. 51 WebGL should trigger GPU process launch if it is allowed.
52 <canvas id="da-canvas" width="500" height="500"></canvas>
32 </body> 53 </body>
33 </html> 54 </html>
OLDNEW
« no previous file with comments | « chrome/test/data/gpu/feature_compositing.html ('k') | chrome/test/gpu/gpu_feature_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698