Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-globalCompositeOperation.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-globalCompositeOperation.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-globalCompositeOperation.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..67afbb4959d0fc80a8eaa4766100c96b3f4ad0ec |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-globalCompositeOperation.html |
| @@ -0,0 +1,29 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| + |
| +<script> |
| +test(function() { |
| + var width = 50; |
| + var height = 50; |
| + var offscreenCanvas1 = new OffscreenCanvas(width, height); |
| + var ctx1 = offscreenCanvas1.getContext('2d'); |
| + var offscreenCanvas2 = new OffscreenCanvas(width, height); |
| + var ctx2 = offscreenCanvas2.getContext('2d'); |
| + |
| + ctx2.fillStyle = '#ff0'; |
| + ctx2.fillRect(0, 0, width, height); |
| + ctx1.fillStyle = '#0ff'; |
| + ctx1.fillRect(0, 0, width, height); |
| + ctx1.globalCompositeOperation = 'copy'; |
| + ctx1.drawImage(offscreenCanvas2, 0, 0); |
| + |
| + var color = ctx1.getImageData(25, 25, 1, 1).data; |
| + |
| + assert_approx_equals(color[0], 255, 5); |
| + assert_approx_equals(color[1], 255, 5); |
| + assert_approx_equals(color[2], 0, 5); |
| + assert_approx_equals(color[3], 255, 5); |
|
Justin Novosad
2016/11/17 19:34:24
This is not really a good test because the pixel v
xidachen
2016/11/18 01:42:57
Done.
|
| +}, 'Test globalCompositeOperation API on OffscreenCanvas'); |
| + |
| +</script> |