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

Unified Diff: content/test/data/gpu/pixel_canvas2d_webgl.html

Issue 1826343003: Add safety checks and reenable Canvas2D/WebGL trace_tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months 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 | « no previous file | content/test/gpu/gpu_tests/trace_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/gpu/pixel_canvas2d_webgl.html
diff --git a/content/test/data/gpu/pixel_canvas2d_webgl.html b/content/test/data/gpu/pixel_canvas2d_webgl.html
index 2eea10aa5d69b1278229355a499f285fe7b0b9e6..dcd1f9a2bc6f96d5056dc8a3f6f8a658b805c7f8 100644
--- a/content/test/data/gpu/pixel_canvas2d_webgl.html
+++ b/content/test/data/gpu/pixel_canvas2d_webgl.html
@@ -23,12 +23,6 @@ var gl;
function main()
{
- draw();
- waitForFinish();
-}
-
-function draw()
-{
var canvas = document.getElementById("c");
canvas.style.width = canvas.style.height = "150px";
var c2d = canvas.getContext("2d");
@@ -38,10 +32,21 @@ function draw()
var webglCanvas = document.getElementById("c2");
gl = initGL(webglCanvas);
+ if (!gl) {
+ console.log('Failed to initialize GL from canvas: ' + webglCanvas);
+ domAutomationController.setAutomationId(1);
+ domAutomationController.send("FAILURE");
+ return;
+ }
+
if (!setup(gl)) {
+ console.log('Failed to set up GL: ' + gl);
domAutomationController.setAutomationId(1);
domAutomationController.send("FAILURE");
+ return;
}
+
+ waitForFinish();
}
function waitForFinish()
« no previous file with comments | « no previous file | content/test/gpu/gpu_tests/trace_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698