Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-getImageData-rounding.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-getImageData-rounding.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-getImageData-rounding.html |
| index a2d93f9e51bcc1d5ee21d76bfdff5335ceea1b25..dbeb1f3c86407294d9c6a32112a33c4e478aa298 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-getImageData-rounding.html |
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-getImageData-rounding.html |
| @@ -1,42 +1,39 @@ |
| -<!DOCTYPE html> |
| -<html> |
| -<head> |
| -<script src="../../resources/js-test.js"></script> |
| -</head> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| <body> |
| <script> |
| -description("Test the handling of non-integer source coordinates in getImageData()."); |
| +test(function(t) { |
| ctx = document.createElement('canvas').getContext('2d'); |
|
Justin Novosad
2017/02/03 18:07:18
indent
|
| -function dimensionsShouldBe(sx, sy, sw, sh, width, height) |
| +function testDimensions(sx, sy, sw, sh, width, height) |
| { |
| imageData = ctx.getImageData(sx, sy, sw, sh); |
| - debug('getImageData(' + sx + ', ' + sy + ', ' + sw + ', ' + sh + ')'); |
| - shouldBe('imageData.width', width + ''); |
| - shouldBe('imageData.height', height + ''); |
| + assert_equals(imageData.width, width); |
| + assert_equals(imageData.height, height); |
| } |
| // Basic integer values |
| -dimensionsShouldBe( 0, 0, 20, 10, 20, 10); |
| +testDimensions( 0, 0, 20, 10, 20, 10); |
| // Source point is not an integer |
| -dimensionsShouldBe( .1, .2, 20, 10, 21, 11); |
| -dimensionsShouldBe( .9, .8, 20, 10, 21, 11); |
| +testDimensions( .1, .2, 20, 10, 21, 11); |
| +testDimensions( .9, .8, 20, 10, 21, 11); |
| // Size is not an integer |
| -dimensionsShouldBe( 0, 0, 19.9, 9.9, 20, 10); |
| -dimensionsShouldBe( 0, 0, 19.1, 9.1, 20, 10); |
| +testDimensions( 0, 0, 19.9, 9.9, 20, 10); |
| +testDimensions( 0, 0, 19.1, 9.1, 20, 10); |
| // Width straddles a pixel boundary |
| -dimensionsShouldBe( .9, 0, .2, 10, 2, 10); |
| +testDimensions( .9, 0, .2, 10, 2, 10); |
| // Basic integer negative values |
| -dimensionsShouldBe( -1, -1, 20, 10, 20, 10); |
| +testDimensions( -1, -1, 20, 10, 20, 10); |
| // Non-integer negative values |
| -dimensionsShouldBe(-1.1, 0, 20, 10, 21, 10); |
| -dimensionsShouldBe(-1.9, 0, 20, 10, 21, 10); |
| +testDimensions(-1.1, 0, 20, 10, 21, 10); |
| +testDimensions(-1.9, 0, 20, 10, 21, 10); |
| + |
| +}, 'Test the handling of non-integer source coordinates in getImageData().'); |
| </script> |
| </body> |
| -</html> |