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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-empty-image-source.html

Issue 2344573002: Correct SourceImageStatus in OffscreenCanvas::getSourceImageForCanvas (Closed)
Patch Set: Adding test Created 4 years, 3 months 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/Source/core/offscreencanvas/OffscreenCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-empty-image-source.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-empty-image-source.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-empty-image-source.html
new file mode 100644
index 0000000000000000000000000000000000000000..5971351a858c4d2147d74f02d3a1f9685f4f6d53
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-empty-image-source.html
@@ -0,0 +1,20 @@
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ var patternCanvas = new OffscreenCanvas(0, 50);
+ var patternCanvasCtx = patternCanvas.getContext("2d");
+ patternCanvasCtx.fillStyle = '#fed';
+ patternCanvasCtx.fillRect(0, 0, 15, 15);
+ var myOCanvas = new OffscreenCanvas(100, 100);
+ var myOCanvasCtx = myOCanvas.getContext("2d");
+ var pattern = myOCanvasCtx.createPattern(patternCanvas, 'repeat');
+ myOCanvasCtx.fillStyle = pattern;
+ myOCanvasCtx.fillRect(0, 0, myOCanvas.width, myOCanvas.height);
+ var imageData = myOCanvasCtx.getImageData(0, 0, 1, 1).data;
+ assert_equals(imageData[0], 0);
+ assert_equals(imageData[1], 0);
+ assert_equals(imageData[2], 0);
+ assert_equals(imageData[3], 0);
+}, "CreatePattern using OffcreenCanvas as image source silently fails when offscreenCanvas has zero size");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698