https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 29ad6b8c4b678cdb1ab4649f8b3acf54cd56bccc authored by Anne van Kesteren on 24 September 2018, 14:41:07 UTC
Fetch/HTTP: test WWW-Authenticate parsing
Tip revision: 29ad6b8
2d.gradient.interpolate.zerosize.fill.html
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>OffscreenCanvas test: 2d.gradient.interpolate.zerosize.fill</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>

<h1>2d.gradient.interpolate.zerosize.fill</h1>
<p class="desc"></p>


<script>
var t = async_test("");
t.step(function() {

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

ctx.fillStyle = '#0f0';
ctx.fillRect(0, 0, 100, 50);
var g = ctx.createLinearGradient(50, 25, 50, 25); // zero-length line (undefined direction)
g.addColorStop(0, '#f00');
g.addColorStop(1, '#f00');
ctx.fillStyle = g;
ctx.rect(0, 0, 100, 50);
ctx.fill();
_assertPixel(offscreenCanvas, 40,20, 0,255,0,255, "40,20", "0,255,0,255");

t.done();

});
</script>
back to top