https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 093b9474d12dc945dccdff7cc35ace71b60c9978 authored by moz-wptsync-bot on 13 March 2018, 19:14:12 UTC
Add a WPT test for calc font-variation-settings.
Tip revision: 093b947
2d.shadow.composite.3.worker.js
// DO NOT EDIT! This test has been generated by tools/gentest.py.
// OffscreenCanvas test in a worker:2d.shadow.composite.3
// Description:Areas outside shadows are drawn correctly with destination-out
// Note:

importScripts("/resources/testharness.js");
importScripts("/common/canvas-tests.js");

var t = async_test("Areas outside shadows are drawn correctly with destination-out");
t.step(function() {

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

ctx.fillStyle = '#0f0';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'destination-out';
ctx.shadowColor = '#f00';
ctx.shadowBlur = 10;
ctx.fillStyle = '#f00';
ctx.fillRect(200, 0, 100, 50);
_assertPixelApprox(offscreenCanvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
_assertPixelApprox(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);

t.done();

});
done();
back to top