blob: 977d18133d4acb9ff78c50fe5d851fef7112c287 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>GPU Feature Testing: WebGL</title>
<script>
var frameCount = 0;
var gl = null;
function init() {
var canvas = document.getElementById("da-canvas");
if (!canvas)
return;
try {
gl = canvas.getContext("webgl");
} catch(e) {}
if (!gl) {
try {
gl = canvas.getContext("experimental-webgl");
} catch(e) {}
}
}
function runTest() {
init();
if (gl)
window.webkitRequestAnimationFrame(draw);
else
endTest();
}
function draw() {
frameCount++;
gl.viewport(0, 0, 10, 10);
gl.clearColor(1.0/frameCount, 0.0, 0.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT);
if (frameCount == 6) {
endTest();
} else {
window.webkitRequestAnimationFrame(draw);
}
}
function endTest() {
domAutomationController.setAutomationId(1);
domAutomationController.send("FINISHED");
}
</script>
</head>
<body onload="runTest()">
WebGL should trigger GPU process launch if it is allowed.
<canvas id="da-canvas" width="10" height="10"></canvas>
</body>
</html>