| Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-blending-gradient-over-color.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-blending-gradient-over-color.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-blending-gradient-over-color.html
|
| index 1912320628ababaa293bba814400bf6e9af336c7..c13ea1e4c22fdb27cb512e0c21eb9f715efb787a 100644
|
| --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-blending-gradient-over-color.html
|
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-blending-gradient-over-color.html
|
| @@ -1,48 +1,21 @@
|
| -<!DOCTYPE HTML>
|
| -<html>
|
| -<body>
|
| - <script src="../../resources/js-test.js"></script>
|
| - <script type="text/javascript" src="canvas-blending-helpers.js"></script>
|
| - <script type="text/javascript">
|
| -
|
| - description("Series of tests to ensure correct results on applying different blend modes when drawing a gradient on top of a color.");
|
| -
|
| - var context;
|
| - function actualColor(x, y) {
|
| - return context.getImageData(x, y, 1, 1).data;
|
| - }
|
| -
|
| - function checkBlendModeResult(i, context, sigma) {
|
| - var expectedColor = blendColors([129 / 255, 1, 129 / 255, 1], [1, 129 / 255, 129 / 255, 1], i);
|
| - var ac = "actualColor(0, 0)";
|
| - shouldBeCloseTo(ac + "[0]", expectedColor[0], sigma);
|
| - shouldBeCloseTo(ac + "[1]", expectedColor[1], sigma);
|
| - shouldBeCloseTo(ac + "[2]", expectedColor[2], sigma);
|
| - shouldBeCloseTo(ac + "[3]", expectedColor[3], sigma);
|
| - }
|
| -
|
| - function runTest() {
|
| - var canvas = document.createElement("canvas");
|
| - var sigma = 5;
|
| - canvas.width = 10;
|
| - canvas.height = 10;
|
| - context = canvas.getContext("2d");
|
| -
|
| - for (var i = 0; i < blendModes.length; ++i) {
|
| - debug("Testing blend mode " + blendModes[i]);
|
| -
|
| - context.clearRect(0, 0, 10, 10);
|
| - context.save();
|
| - drawBackdropColorInContext(context);
|
| - context.globalCompositeOperation = blendModes[i];
|
| - drawSourceColorGradientInContext(context);
|
| - checkBlendModeResult(i, context, sigma);
|
| - context.restore();
|
| - debug('');
|
| - }
|
| - }
|
| -
|
| - runTest();
|
| - </script>
|
| -</body>
|
| -</html>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script type="text/javascript" src="canvas-blending-helpers.js"></script>
|
| +<script>
|
| +test(function(t) {
|
| + var canvas = document.createElement('canvas');
|
| + var sigma = 5;
|
| + canvas.width = 10;
|
| + canvas.height = 10;
|
| + context = canvas.getContext('2d');
|
| + for (var i = 0; i < blendModes.length; ++i) {
|
| + context.clearRect(0, 0, 10, 10);
|
| + context.save();
|
| + drawBackdropColorInContext(context);
|
| + context.globalCompositeOperation = blendModes[i];
|
| + drawSourceColorGradientInContext(context);
|
| + checkBlendModeResult(i, context, sigma);
|
| + context.restore();
|
| + }
|
| +}, 'Series of tests to ensure correct results on applying different blend modes when drawing a gradient on top of a color.');
|
| +</script>
|
|
|