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

Unified Diff: chrome/test/data/gpu/feature_canvas2d.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 | « base/debug/trace_event.h ('k') | chrome/test/data/gpu/feature_compositing.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/gpu/feature_canvas2d.html
diff --git a/chrome/test/data/gpu/feature_canvas2d.html b/chrome/test/data/gpu/feature_canvas2d.html
index eb07a6a2dd69abf70daba5a6c5c120d82e56659e..6f5519335c20459fc91838eb36e2c4f9a8eec3b3 100644
--- a/chrome/test/data/gpu/feature_canvas2d.html
+++ b/chrome/test/data/gpu/feature_canvas2d.html
@@ -4,26 +4,38 @@
<meta charset="utf-8">
<title>GPU Feature Testing: Canvas2D</title>
<script>
+var frameCount = 0;
+var context = null;
+
function init() {
- var canvas = document.createElement("canvas");
+ var canvas = document.getElementById("da-canvas");
if (!canvas)
- return null;
- // Make sure canvas is large enough to trigger gpu acceleration.
- canvas.width = 500;
- canvas.height = 500;
- var context = null;
+ return;
try {
context = canvas.getContext("2d");
} catch(e) {}
- return context;
}
function runTest() {
- var c2d = init();
- if (c2d) {
- // Initialization was triggered lazily on the first draw.
- c2d.fillRect(0, 0, 1, 1);
+ init();
+ if (context)
+ window.webkitRequestAnimationFrame(draw);
+ else
+ endTest();
+}
+
+function draw() {
+ frameCount++;
+ document.body.style.backgroundColor = (frameCount & 1) ? "red" : "blue";
+ context.fillRect(0, 0, 500, frameCount*100);
+ if (frameCount == 5) {
+ endTest();
+ } else {
+ window.webkitRequestAnimationFrame(draw);
}
+}
+
+function endTest() {
domAutomationController.setAutomationId(1);
domAutomationController.send("FINISHED");
}
@@ -31,5 +43,6 @@ function runTest() {
</head>
<body onload="runTest()">
Canvas2D should trigger GPU process launch if accelerated-2d-canvas is allowed.
+<canvas id="da-canvas" width="500" height="500"></canvas>
</body>
</html>
« no previous file with comments | « base/debug/trace_event.h ('k') | chrome/test/data/gpu/feature_compositing.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698