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

Side by Side Diff: content/test/data/gpu/webgl.html

Issue 2152283004: Abort ContextLost.WebGLContextLostFromQuantity if context creation fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/test/gpu/gpu_tests/context_lost.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script type="text/javascript"> 3 <script type="text/javascript">
4 var canvas; 4 var canvas;
5 var w, h; 5 var w, h;
6 var gl; 6 var gl;
7 var extension; 7 var extension;
8 8
9 var alreadySetAutomationId = false; 9 var alreadySetAutomationId = false;
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 function createAndDiscardContext() { 67 function createAndDiscardContext() {
68 count++; 68 count++;
69 69
70 var c = document.createElement("canvas"); 70 var c = document.createElement("canvas");
71 c.width = 1; 71 c.width = 1;
72 c.height = 1; 72 c.height = 1;
73 garbageCanvases.push(c); 73 garbageCanvases.push(c);
74 74
75 var ctx = c.getContext("experimental-webgl"); 75 var ctx = c.getContext("experimental-webgl");
76 if (!ctx) { 76 if (!ctx) {
77 console.log("Failed to fetch WebGL context number " + count);
78 window.domAutomationController.send("LOADED");
79 window.domAutomationController.send("FAILED");
77 return false; 80 return false;
78 } 81 }
79 ctx.clear(gl.COLOR_BUFFER_BIT); 82 ctx.clear(gl.COLOR_BUFFER_BIT);
80 83
81 if (count < iterations) { 84 if (count < iterations) {
82 window.requestAnimationFrame(createAndDiscardContext); 85 window.requestAnimationFrame(createAndDiscardContext);
83 } else { 86 } else {
84 // Remove the references to the garbage canvases, then attempt to trigger 87 // Remove the references to the garbage canvases, then attempt to trigger
85 // a garbage collect. 88 // a garbage collect.
86 garbageCanvases = null; 89 garbageCanvases = null;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 if (query) 167 if (query)
165 contextLostTest(query[1]); 168 contextLostTest(query[1]);
166 } 169 }
167 </script> 170 </script>
168 </head> 171 </head>
169 <body onload="onLoad()"> 172 <body onload="onLoad()">
170 <canvas id="canvas1" width="16px" height="32px"> 173 <canvas id="canvas1" width="16px" height="32px">
171 </canvas> 174 </canvas>
172 </body> 175 </body>
173 </html> 176 </html>
OLDNEW
« no previous file with comments | « no previous file | content/test/gpu/gpu_tests/context_lost.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698