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

Unified 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: tests seem to be fixed Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/gpu/feature_webgl.html
diff --git a/chrome/test/data/gpu/feature_webgl.html b/chrome/test/data/gpu/feature_webgl.html
index cd6566d64740a6dc2b571a2195aef379124d6b0f..c57be092f530f379ea7309cae24e2e7e4297b59e 100644
--- a/chrome/test/data/gpu/feature_webgl.html
+++ b/chrome/test/data/gpu/feature_webgl.html
@@ -4,24 +4,44 @@
<meta charset="utf-8">
<title>GPU Feature Testing: WebGL</title>
<script>
+var frameCount = 0;
+var gl = null;
+
function init() {
- var canvas = document.createElement("canvas");
+ var canvas = document.getElementById("da-canvas");
if (!canvas)
- return null;
- var context = null;
+ return;
try {
- context = canvas.getContext("webgl");
+ gl = canvas.getContext("webgl");
} catch(e) {}
- if (!context) {
+ if (!gl) {
try {
- context = canvas.getContext("experimental-webgl");
+ gl = canvas.getContext("experimental-webgl");
} catch(e) {}
}
- return context;
}
function runTest() {
- var gl = init();
+ init();
+ if (gl)
+ window.webkitRequestAnimationFrame(draw);
+ else
+ endTest();
+}
+
+function draw() {
+ frameCount++;
+ gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);
Zhenyao Mo 2011/11/30 18:58:47 I don't think viewportWidth/Height are supported.
jbates 2011/11/30 20:21:52 Done.
+ gl.clearColor(1.0/frameCount, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ if (frameCount == 5) {
+ endTest();
+ } else {
+ window.webkitRequestAnimationFrame(draw);
+ }
+}
+
+function endTest() {
domAutomationController.setAutomationId(1);
domAutomationController.send("FINISHED");
}
@@ -29,5 +49,6 @@ function runTest() {
</head>
<body onload="runTest()">
WebGL should trigger GPU process launch if it is allowed.
+<canvas id="da-canvas" width="500" height="500"></canvas>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698