| OLD | NEW |
| 1 <head> | 1 <script src="../../resources/testharness.js"></script> |
| 2 <script src="../../resources/testharnessreport.js"></script> |
| 3 <canvas id="bigCanvas" width="134217728" height="1"></canvas> |
| 4 |
| 2 <script> | 5 <script> |
| 3 function print(message) | 6 function runTest() { |
| 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.testRunner) | |
| 12 testRunner.dumpAsText(); | |
| 13 | |
| 14 var canvas = document.getElementById("bigCanvas"); | 7 var canvas = document.getElementById("bigCanvas"); |
| 15 var width = canvas.width; | 8 var width = canvas.width; |
| 16 // We need to perform a context fetch to force allocation of | 9 // We need to perform a context fetch to force allocation of canvas resource
s. |
| 17 // canvas resources. | 10 var ctx = canvas.getContext("2d"); |
| 18 if (canvas.getContext) | 11 assert_false(ctx == null); |
| 19 { | 12 assert_equals(canvas.width, 134217728); |
| 20 var ctx = canvas.getContext("2d"); | 13 } |
| 21 if (ctx == null) | |
| 22 { | |
| 23 print("Canvas 2d context = null!"); | |
| 24 } | |
| 25 } | |
| 26 | 14 |
| 27 print("Survived canvas creation attempt. Width = " + width); | 15 async_test(t => { |
| 28 } | 16 window.onload = function() { |
| 17 t.step(runTest); |
| 18 t.done(); |
| 19 } |
| 20 }, 'Verifies if the browser survives the attempted creation of an excessively la
rge canvas.'); |
| 29 </script> | 21 </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 |