| Index: third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-currentColor.js
|
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-currentColor.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-currentColor.js
|
| deleted file mode 100644
|
| index 09b5ddfdc103aef881a14f2844654b7d4713f585..0000000000000000000000000000000000000000
|
| --- a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-currentColor.js
|
| +++ /dev/null
|
| @@ -1,63 +0,0 @@
|
| -description("Test that CanvasRenderingContext2D supports the 'currentColor' value.");
|
| -
|
| -canvas = document.createElement('canvas');
|
| -canvas.width = 100;
|
| -canvas.height = 100;
|
| -ctx = canvas.getContext('2d');
|
| -
|
| -function attachCanvasToDocument() {
|
| - document.body.appendChild(canvas);
|
| - return document.body.parentNode != null;
|
| -}
|
| -
|
| -function tryLinearGradientColor(color) {
|
| - var gradient = ctx.createLinearGradient(0, 0, 100, 100);
|
| - gradient.addColorStop(0, color);
|
| - gradient.addColorStop(1, color);
|
| - ctx.fillStyle = gradient;
|
| - ctx.fillRect(0, 0, 100, 100);
|
| - var data = ctx.getImageData(0, 0, 1, 1).data;
|
| - return '' + data[0] + ',' + data[1] + ',' + data[2] + ',' + data[3];
|
| -}
|
| -
|
| -function tryRadialGradientColor(color) {
|
| - var gradient = ctx.createRadialGradient(0, 0, 100, 100, 100, 100);
|
| - gradient.addColorStop(0, color);
|
| - gradient.addColorStop(1, color);
|
| - ctx.fillStyle = gradient;
|
| - ctx.fillRect(0, 0, 100, 100);
|
| - var data = ctx.getImageData(0, 0, 1, 1).data;
|
| - return '' + data[0] + ',' + data[1] + ',' + data[2] + ',' + data[3];
|
| -}
|
| -
|
| -// First we test with the canvas out-of-document, 'currentColor' should mean black
|
| -shouldBe("ctx.shadowColor = '#f00'; ctx.shadowColor", "'#ff0000'");
|
| -shouldBe("ctx.shadowColor = 'currentColor'; ctx.shadowColor", "'#000000'");
|
| -shouldBe("ctx.fillStyle = '#f00'; ctx.fillStyle", "'#ff0000'");
|
| -shouldBe("ctx.fillStyle = 'currentColor'; ctx.fillStyle", "'#000000'");
|
| -shouldBe("ctx.strokeStyle = '#f00'; ctx.strokeStyle", "'#ff0000'");
|
| -shouldBe("ctx.strokeStyle = 'currentColor'; ctx.strokeStyle", "'#000000'");
|
| -shouldBe("tryLinearGradientColor('#f00')", "'255,0,0,255'");
|
| -shouldBe("tryLinearGradientColor('currentColor')", "'0,0,0,255'");
|
| -shouldBe("tryRadialGradientColor('#f00')", "'255,0,0,255'");
|
| -shouldBe("tryRadialGradientColor('currentColor')", "'0,0,0,255'");
|
| -
|
| -// Attach to the document and set the canvas's color to #123456
|
| -shouldBe("attachCanvasToDocument()", "true");
|
| -shouldBe("canvas.style.color = '#123456'; canvas.style.color", "'rgb(18, 52, 86)'");
|
| -
|
| -// 'currentColor' should now mean #123456
|
| -shouldBe("ctx.shadowColor = '#f00'; ctx.shadowColor", "'#ff0000'");
|
| -shouldBe("ctx.shadowColor = 'currentColor'; ctx.shadowColor", "'#123456'");
|
| -shouldBe("ctx.fillStyle = '#f00'; ctx.fillStyle", "'#ff0000'");
|
| -shouldBe("ctx.fillStyle = 'currentColor'; ctx.fillStyle", "'#123456'");
|
| -shouldBe("ctx.strokeStyle = '#f00'; ctx.strokeStyle", "'#ff0000'");
|
| -shouldBe("ctx.strokeStyle = 'currentColor'; ctx.strokeStyle", "'#123456'");
|
| -shouldBe("tryLinearGradientColor('#f00')", "'255,0,0,255'");
|
| -shouldBe("tryLinearGradientColor('currentColor')", "'0,0,0,255'");
|
| -shouldBe("tryRadialGradientColor('#f00')", "'255,0,0,255'");
|
| -shouldBe("tryRadialGradientColor('currentColor')", "'0,0,0,255'");
|
| -
|
| -// Last but not least, verify that we're case insensitive
|
| -shouldBe("ctx.shadowColor = '#f00'; ctx.shadowColor", "'#ff0000'");
|
| -shouldBe("ctx.shadowColor = 'CURRENTCOLOR'; ctx.shadowColor", "'#123456'");
|
|
|