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

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

Issue 418733002: Prevent duplicate navigation to debug URLs from Telemetry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment. Created 6 years, 5 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 | « content/common/gpu/gpu_messages.h ('k') | content/test/gpu/gpu_tests/context_lost.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/gpu/gpu_process_crash.html
diff --git a/content/test/data/gpu/gpu_process_crash.html b/content/test/data/gpu/gpu_process_crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..a53e55c26cdf0f37bc630c695842eb3d0c44e434
--- /dev/null
+++ b/content/test/data/gpu/gpu_process_crash.html
@@ -0,0 +1,52 @@
+<html>
+<head>
+<script type="text/javascript">
+function onLoad() {
+ window.domAutomationController.reset = function() {
+ window.domAutomationController._loaded = false;
+ window.domAutomationController._succeeded = false;
+ window.domAutomationController._finished = false;
+ window.requestAnimationFrame(draw);
+ };
+ window.domAutomationController.send("LOADED");
+}
+
+function draw() {
+ // Render some WebGL into a fresh canvas to ensure the GPU process
+ // was created.
+ var canvas = document.createElement("canvas");
+ canvas.width = 32;
+ canvas.height = 32;
+ gl = canvas.getContext("webgl");
+ if (!gl) {
+ console.log("Failed to fetch WebGL context");
+ window.domAutomationController.send("FAILED");
+ return;
+ }
+
+ gl.clearColor(1, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ var pixels = new Uint8Array(4);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
+ var tolerance = 1;
+ if (Math.abs(pixels[0] - 255) > tolerance ||
+ Math.abs(pixels[1] - 0) > tolerance ||
+ Math.abs(pixels[2] - 0) > tolerance ||
+ Math.abs(pixels[3] - 255) > tolerance) {
+ console.log("Expected (255, 0, 0, 255), got (" +
+ pixels[0] + ", " +
+ pixels[1] + ", " +
+ pixels[2] + ", " +
+ pixels[3] + ")");
+ window.domAutomationController.send("FAILED");
+ return;
+ }
+
+ window.domAutomationController.send("SUCCESS");
+}
+</script>
+</head>
+<body onload="onLoad()">
+GPU process crash test running.
+</body>
+</html>
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | content/test/gpu/gpu_tests/context_lost.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698