Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-getImageData-rounding.html

Issue 2771933002: Update createImageData/getImageData/putImageData from float to long (Closed)
Patch Set: Reset tests Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 fa1766c49b58a5589c730327214e69185df40d52..0850db47cabd853875c60176f592b93852ccbb50 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-getImageData-rounding.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-getImageData-rounding.html
@@ -4,34 +4,31 @@
<script>
test(function(t) {
ctx = document.createElement('canvas').getContext('2d');
-
+
function testDimensions(sx, sy, sw, sh, width, height)
{
imageData = ctx.getImageData(sx, sy, sw, sh);
assert_equals(imageData.width, width);
assert_equals(imageData.height, height);
}
-
+
// Basic integer values
testDimensions( 0, 0, 20, 10, 20, 10);
-
+
// Source point is not an integer
- testDimensions( .1, .2, 20, 10, 21, 11);
- testDimensions( .9, .8, 20, 10, 21, 11);
-
+ testDimensions( .1, .2, 20, 10, 20, 10);
+ testDimensions( .9, .8, 20, 10, 20, 10);
+
// Size is not an integer
- testDimensions( 0, 0, 19.9, 9.9, 20, 10);
- testDimensions( 0, 0, 19.1, 9.1, 20, 10);
-
- // Width straddles a pixel boundary
- testDimensions( .9, 0, .2, 10, 2, 10);
-
+ testDimensions( 0, 0, 20.9, 10.9, 20, 10);
+ testDimensions( 0, 0, 20.1, 10.1, 20, 10);
+
// Basic integer negative values
testDimensions( -1, -1, 20, 10, 20, 10);
-
+
// Non-integer negative values
- testDimensions(-1.1, 0, 20, 10, 21, 10);
- testDimensions(-1.9, 0, 20, 10, 21, 10);
+ testDimensions(-1.1, 0, 20, 10, 20, 10);
+ testDimensions(-1.9, 0, 20, 10, 20, 10);
}, 'Test the handling of non-integer source coordinates in getImageData().');
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698