| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <canvas id="mycanvas"><button id="button"></button></canvas> | 2 <canvas id="mycanvas"><button id="button"></button></canvas> |
| 3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 description("This tests verifies that canvas API calls on a canvas with no backi
ng or no visibility do not crash or throw exceptions."); | 5 description("This tests verifies that canvas API calls on a canvas with no backi
ng or no visibility do not crash or throw exceptions."); |
| 6 | 6 |
| 7 if (window.testRunner) { | 7 if (window.testRunner) { |
| 8 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 | 43 |
| 44 // First pass: normal conditions | 44 // First pass: normal conditions |
| 45 testAPICalls(); | 45 testAPICalls(); |
| 46 | 46 |
| 47 // Test a zero size canvas | 47 // Test a zero size canvas |
| 48 canvas.width = 0; | 48 canvas.width = 0; |
| 49 testAPICalls(); | 49 testAPICalls(); |
| 50 | 50 |
| 51 // Test a canvas so large that it has no chance of successfull allocating a back
ing | 51 // Test a canvas so large that it has no chance of successful allocating a backi
ng |
| 52 canvas.width = 10000000; | 52 canvas.width = 10000000; |
| 53 canvas.height = 10000000; | 53 canvas.height = 10000000; |
| 54 testAPICalls(); | 54 testAPICalls(); |
| 55 | 55 |
| 56 // Test a canvas that is valid, but detached from the DOM | 56 // Test a canvas that is valid, but detached from the DOM |
| 57 canvas.width = 100; | 57 canvas.width = 100; |
| 58 canvas.height = 100; | 58 canvas.height = 100; |
| 59 canvas.remove(); | 59 canvas.remove(); |
| 60 testAPICalls(); | 60 testAPICalls(); |
| 61 | 61 |
| 62 </script> | 62 </script> |
| OLD | NEW |