Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / script-tests / canvas-strokeText-zeroSizeGradient.js
blob722e1b1ff624bf3256d7203b87c5758491338a43
1 description("Series of tests to ensure that strokeText() paints nothing on canvas when the strokeStyle is set to a zero-size gradient.");
2 var ctx = document.createElement('canvas').getContext('2d');
4 ctx.fillStyle = '#0f0';
5 ctx.fillRect(0, 0, 1, 1);
7 var g = ctx.createLinearGradient(0, 0, 0, 0); // zero-length line (undefined direction);
8 g.addColorStop(0, '#f00');
9 g.addColorStop(1, '#f00');
10 ctx.strokeStyle = g;
11 ctx.font = '1px sans-serif';
12 ctx.strokeText("AA", 0, 1);
14 var imageData = ctx.getImageData(0, 0, 1, 1);
15 var imgdata = imageData.data;
16 shouldBe("imgdata[0]", "0");
17 shouldBe("imgdata[1]", "255");
18 shouldBe("imgdata[2]", "0");