chromium/third_party/blink/web_tests/fast/canvas/canvas-fill-zeroSizeGradient.html

<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<body>
<canvas id="c"></canvas>
<script>
test(function(t) {
    var ctx = document.getElementById("c").getContext('2d');

    ctx.fillStyle = '#0f0';
    ctx.fillRect(0, 0, 100, 100);

    var g = ctx.createLinearGradient(0, 0, 0, 0); // zero-length line (undefined direction);
    g.addColorStop(0, '#f00');
    g.addColorStop(1, '#f00');
    ctx.fillStyle = g;
    ctx.font = '10px serif';
    ctx.fillText("AA", 10, 10);

    var imageData = ctx.getImageData(0, 0, 1, 1);
    var imgdata = imageData.data;
    assert_approx_equals(imgdata[0]*imgdata[3]/255, 0, 50);
    assert_approx_equals(imgdata[1]*imgdata[3]/255, 255, 50);
    assert_approx_equals(imgdata[2]*imgdata[3]/255, 0, 50);

}, "Series of tests to ensure that fillText() paints nothing on canvas when the fillStyle is set to a zero-size gradient.");
</script>
</body>