| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script type="text/javascript"> | 4 <script type="text/javascript"> |
| 5 function popup() { | 5 function popup() { |
| 6 var w = window.open("","","width=200,height=200"); | 6 var w = window.open("","","width=200,height=200"); |
| 7 var canvas = w.document.createElement("canvas"); | 7 var canvas = w.document.createElement("canvas"); |
| 8 canvas.width = 100; | 8 canvas.width = 100; |
| 9 canvas.height = 100; | 9 canvas.height = 100; |
| 10 w.document.body.appendChild(canvas); | 10 w.document.body.appendChild(canvas); |
| 11 | 11 |
| 12 var gl = canvas.getContext("experimental-webgl"); | 12 var gl = canvas.getContext("experimental-webgl"); |
| 13 gl.clearColor(1.0, 0.0, 0.0, 1.0); | 13 gl.clearColor(1.0, 0.0, 0.0, 1.0); |
| 14 gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); | 14 gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); |
| 15 | 15 |
| 16 var a = new Uint8Array(4); | 16 var a = new Uint8Array(4); |
| 17 gl.readPixels(50, 50, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, a); | 17 gl.readPixels(50, 50, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, a); |
| 18 document.title = a[0] + ", " + a[1] + ", " + a[2]; | 18 document.title = a[0] + ", " + a[1] + ", " + a[2]; |
| 19 | 19 |
| 20 window.domAutomationController.setAutomationId(1); | |
| 21 if (a[0] == 255 && a[1] == 0 && a[2] == 0) | 20 if (a[0] == 255 && a[1] == 0 && a[2] == 0) |
| 22 window.domAutomationController.send("SUCCESS"); | 21 window.domAutomationController.send("SUCCESS"); |
| 23 else | 22 else |
| 24 window.domAutomationController.send("FAILED"); | 23 window.domAutomationController.send("FAILED"); |
| 25 } | 24 } |
| 26 </script> | 25 </script> |
| 27 </head> | 26 </head> |
| 28 <body onload="popup()"> | 27 <body onload="popup()"> |
| 29 </body> | 28 </body> |
| 30 </html> | 29 </html> |
| OLD | NEW |