Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / test / data / gpu / feature_webgl.html
blob977d18133d4acb9ff78c50fe5d851fef7112c287
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>GPU Feature Testing: WebGL</title>
6 <script>
7 var frameCount = 0;
8 var gl = null;
10 function init() {
11 var canvas = document.getElementById("da-canvas");
12 if (!canvas)
13 return;
14 try {
15 gl = canvas.getContext("webgl");
16 } catch(e) {}
17 if (!gl) {
18 try {
19 gl = canvas.getContext("experimental-webgl");
20 } catch(e) {}
24 function runTest() {
25 init();
26 if (gl)
27 window.webkitRequestAnimationFrame(draw);
28 else
29 endTest();
32 function draw() {
33 frameCount++;
34 gl.viewport(0, 0, 10, 10);
35 gl.clearColor(1.0/frameCount, 0.0, 0.0, 1.0);
36 gl.clear(gl.COLOR_BUFFER_BIT);
37 if (frameCount == 6) {
38 endTest();
39 } else {
40 window.webkitRequestAnimationFrame(draw);
44 function endTest() {
45 domAutomationController.setAutomationId(1);
46 domAutomationController.send("FINISHED");
48 </script>
49 </head>
50 <body onload="runTest()">
51 WebGL should trigger GPU process launch if it is allowed.
52 <canvas id="da-canvas" width="10" height="10"></canvas>
53 </body>
54 </html>