OLD | NEW |
(Empty) | |
| 1 <head> |
| 2 <script> |
| 3 function print(message) |
| 4 { |
| 5 var paragraph = document.createElement("li"); |
| 6 paragraph.appendChild(document.createTextNode(message)); |
| 7 document.getElementById("console").appendChild(paragraph); |
| 8 } |
| 9 function test() |
| 10 { |
| 11 if (window.layoutTestController) |
| 12 layoutTestController.dumpAsText(); |
| 13 |
| 14 var canvas = document.getElementById("bigCanvas"); |
| 15 var width = canvas.width; |
| 16 // We need to perform a context fetch to force allocation of |
| 17 // canvas resources. |
| 18 if (canvas.getContext) |
| 19 { |
| 20 var ctx = canvas.getContext("2d"); |
| 21 if (ctx == null) |
| 22 { |
| 23 print("Canvas 2d context = null!"); |
| 24 } |
| 25 } |
| 26 |
| 27 print("Survived canvas creation attempt. Width = " + width); |
| 28 } |
| 29 </script> |
| 30 </head> |
| 31 <body onload="test();"> |
| 32 <canvas id="bigCanvas" width="134217728" height="1"></canvas> |
| 33 <p>This test checks to see if the browser survives the attempted creation |
| 34 of an excessively large canvas.</p> |
| 35 <hr> |
| 36 <p><ol id=console></ol></p> |
| 37 </body> |
OLD | NEW |