| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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> |
| OLD | NEW |