| 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 function testHorizontalBands() { | 9 function testHorizontalBands() { |
| 10 gl.enable(gl.SCISSOR_TEST); | 10 gl.enable(gl.SCISSOR_TEST); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 if (extension) { | 32 if (extension) { |
| 33 setTimeout(function() { | 33 setTimeout(function() { |
| 34 extension.restoreContext(); | 34 extension.restoreContext(); |
| 35 }, 0); | 35 }, 0); |
| 36 } | 36 } |
| 37 } | 37 } |
| 38 | 38 |
| 39 function testContextRestored() { | 39 function testContextRestored() { |
| 40 gl = canvas.getContext("experimental-webgl"); | 40 gl = canvas.getContext("experimental-webgl"); |
| 41 if (!gl || gl.isContextLost()) { | 41 if (!gl || gl.isContextLost()) { |
| 42 document.title = "FAILED: could not get recovered context"; | 42 // Might just be blocked because of infobar. |
| 43 return; | 43 return; |
| 44 } | 44 } |
| 45 gl.clearColor(0, 0, 1, 1); | 45 gl.clearColor(0, 0, 1, 1); |
| 46 gl.clear(gl.COLOR_BUFFER_BIT); | 46 gl.clear(gl.COLOR_BUFFER_BIT); |
| 47 | 47 |
| 48 var a = new Uint8Array(w * h * 4); | 48 var a = new Uint8Array(w * h * 4); |
| 49 gl.readPixels(0, 0, w, h, gl.RGBA, gl.UNSIGNED_BYTE, a); | 49 gl.readPixels(0, 0, w, h, gl.RGBA, gl.UNSIGNED_BYTE, a); |
| 50 | 50 |
| 51 window.domAutomationController.setAutomationId(1); | 51 window.domAutomationController.setAutomationId(1); |
| 52 if (a[0] == 0 && a[1] == 0 && a[2] == 255) | 52 if (a[0] == 0 && a[1] == 0 && a[2] == 255) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 document.title = "SUCCESS: " + renderer; | 101 document.title = "SUCCESS: " + renderer; |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 </script> | 104 </script> |
| 105 </head> | 105 </head> |
| 106 <body onload="onLoad()"> | 106 <body onload="onLoad()"> |
| 107 <canvas id="canvas1" width="16px" height="32px"> | 107 <canvas id="canvas1" width="16px" height="32px"> |
| 108 </canvas> | 108 </canvas> |
| 109 </body> | 109 </body> |
| 110 </html> | 110 </html> |
| OLD | NEW |