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

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: re-added DLOG 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
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..15b581b1142fb11e82eceec214b57345acff9fbb 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, 500, 500);
+ 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>
« 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