OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> |
| 6 <body> |
| 7 <script> |
| 8 if (window.testRunner) { |
| 9 testRunner.dumpAsText(); |
| 10 } |
| 11 var canvas = document.createElement('canvas'); |
| 12 canvas.width = 100; |
| 13 canvas.height = 100; |
| 14 var ctx = canvas.getContext('2d'); |
| 15 if (!window.internals) { |
| 16 testFailed('Test requires the internals interface.'); |
| 17 } else { |
| 18 var data; |
| 19 internals.fakeOutOfMemoryForNextArrayBufferAllocation(); |
| 20 shouldThrow('data = ctx.getImageData(0, 0, 100, 100)'); |
| 21 shouldNotThrow('data = ctx.getImageData(0, 0, 100, 100)'); |
| 22 |
| 23 internals.fakeOutOfMemoryForNextArrayBufferAllocation(); |
| 24 shouldThrow('data = ctx.createImageData(100, 100)'); |
| 25 shouldNotThrow('data = ctx.createImageData(100, 100)'); |
| 26 |
| 27 internals.fakeOutOfMemoryForNextArrayBufferAllocation(); |
| 28 shouldThrow('data = new ImageData(100, 100)'); |
| 29 shouldNotThrow('data = new ImageData(100, 100)'); |
| 30 } |
| 31 </script> |
| 32 </body> |
| 33 </html> |
OLD | NEW |