https://github.com/web-platform-tests/wpt
Raw File
Tip revision: ccef6bd283af10f72b14e455f8d9f22e3cf97424 authored by Chris Lilley on 12 April 2018, 14:39:49 UTC
test the ffs descriptor (property already tested)
Tip revision: ccef6bd
2d.shadow.composite.2.html
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>OffscreenCanvas test: 2d.shadow.composite.2</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>

<h1>2d.shadow.composite.2</h1>
<p class="desc">Shadows are drawn using globalCompositeOperation</p>


<script>
var t = async_test("Shadows are drawn using globalCompositeOperation");
t.step(function() {

var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');

ctx.fillStyle = '#f00';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'xor';
ctx.shadowColor = '#f00';
ctx.shadowBlur = 1;
ctx.fillStyle = '#0f0';
ctx.fillRect(-10, -10, 120, 70);
_assertPixelApprox(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);

t.done();

});
</script>
back to top