| Index: third_party/WebKit/LayoutTests/fast/canvas/imageData-oom.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/imageData-oom.html b/third_party/WebKit/LayoutTests/fast/canvas/imageData-oom.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f4028c8d81d44f3e795a0042b7c57c8ee6ffb638
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/imageData-oom.html
|
| @@ -0,0 +1,33 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<script src="../../resources/js-test.js"></script>
|
| +</head>
|
| +<body>
|
| +<script>
|
| +if (window.testRunner) {
|
| + testRunner.dumpAsText();
|
| +}
|
| +var canvas = document.createElement('canvas');
|
| +canvas.width = 100;
|
| +canvas.height = 100;
|
| +var ctx = canvas.getContext('2d');
|
| +if (!window.internals) {
|
| + testFailed('Test requires the internals interface.');
|
| +} else {
|
| + var data;
|
| + internals.fakeOutOfMemoryForNextArrayBufferAllocation();
|
| + shouldThrow('data = ctx.getImageData(0, 0, 100, 100)');
|
| + shouldNotThrow('data = ctx.getImageData(0, 0, 100, 100)');
|
| +
|
| + internals.fakeOutOfMemoryForNextArrayBufferAllocation();
|
| + shouldThrow('data = ctx.createImageData(100, 100)');
|
| + shouldNotThrow('data = ctx.createImageData(100, 100)');
|
| +
|
| + internals.fakeOutOfMemoryForNextArrayBufferAllocation();
|
| + shouldThrow('data = new ImageData(100, 100)');
|
| + shouldNotThrow('data = new ImageData(100, 100)');
|
| +}
|
| +</script>
|
| +</body>
|
| +</html>
|
|
|