Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-drawImage-noContext.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-drawImage-noContext.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-drawImage-noContext.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8b60feb7a0b9d303c2854ec2c18ec5d83f85d911 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-drawImage-noContext.html |
| @@ -0,0 +1,18 @@ |
| +<!DOCTYPE HTML> |
|
Justin Novosad
2016/12/01 19:39:57
Nit: the file name should be ...-no-context rather
|
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<script> |
| +test(function() { |
| + var offscreenCanvas = new OffscreenCanvas(100, 50); |
| + var ctx = offscreenCanvas.getContext('2d'); |
| + ctx.fillStyle = "#0f0"; |
| + ctx.fillRect(0, 0, 100, 50); |
| + ctx.globalCompositeOperation = 'copy'; |
|
Justin Novosad
2016/12/01 19:39:57
Add a comment to explain why 'copy' is important f
|
| + |
| + var offscreenCanvas2 = new OffscreenCanvas(100, 50); |
| + ctx.drawImage(offscreenCanvas2, 0, 0); |
| + |
| + var clr = ctx.getImageData(50, 25, 1, 1).data; |
| + assert_array_equals(clr, [0, 0, 0, 0]); |
| +}, 'Use OffscreenCanvas without a context as ImageSource should draw transparent black'); |
| +</script> |