Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(894)

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/imageData-oom.html

Issue 1414553002: Fix out-of-memory crashes related to ArrayBuffer allocation Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase+more tweaks Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/imageData-oom-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/imageData-oom-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698