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

Side by Side Diff: LayoutTests/fast/canvas/script-tests/canvas-currentTransform.js

Issue 36843003: Improve remaining TypeErrors in bindings code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: vibration. Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 description("Series of tests to ensure correct behaviour of canvas.currentTransf orm"); 1 description("Series of tests to ensure correct behaviour of canvas.currentTransf orm");
2 var ctx = document.createElement('canvas').getContext('2d'); 2 var ctx = document.createElement('canvas').getContext('2d');
3 3
4 var matrix = ctx.currentTransform; 4 var matrix = ctx.currentTransform;
5 5
6 debug("Check initial currentTransform values"); 6 debug("Check initial currentTransform values");
7 shouldBe("matrix.a", "1"); 7 shouldBe("matrix.a", "1");
8 shouldBe("matrix.b", "0"); 8 shouldBe("matrix.b", "0");
9 shouldBe("matrix.c", "0"); 9 shouldBe("matrix.c", "0");
10 shouldBe("matrix.d", "1"); 10 shouldBe("matrix.d", "1");
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 ctx.fillStyle = 'blue'; 167 ctx.fillStyle = 'blue';
168 ctx.fillRect(0, 0, 100, 100); 168 ctx.fillRect(0, 0, 100, 100);
169 169
170 imageData = ctx.getImageData(1, 1, 98, 98); 170 imageData = ctx.getImageData(1, 1, 98, 98);
171 imgdata = imageData.data; 171 imgdata = imageData.data;
172 shouldBe("imgdata[4]", "0"); 172 shouldBe("imgdata[4]", "0");
173 shouldBe("imgdata[5]", "0"); 173 shouldBe("imgdata[5]", "0");
174 shouldBe("imgdata[6]", "255"); 174 shouldBe("imgdata[6]", "255");
175 175
176 debug("Check assigning an invalid object throws exception as expected"); 176 debug("Check assigning an invalid object throws exception as expected");
177 shouldThrow("ctx.currentTransform = ctx", "'TypeError: Type error'"); 177 shouldThrow("ctx.currentTransform = ctx", '"TypeError: Failed to set the \'curre ntTransform\' property on \'CanvasRenderingContext2D\': The provided value is no t of type \'SVGMatrix\'."');
178 178
179 debug("Check handling non-finite values. see 2d.transformation.setTransform.nonf inite.html"); 179 debug("Check handling non-finite values. see 2d.transformation.setTransform.nonf inite.html");
180 ctx.fillStyle = 'red'; 180 ctx.fillStyle = 'red';
181 ctx.fillRect(0, 0, 100, 100); 181 ctx.fillRect(0, 0, 100, 100);
182 182
183 function setCurrentTransformToNonfinite(ctx, a, b, c, d, e, f) 183 function setCurrentTransformToNonfinite(ctx, a, b, c, d, e, f)
184 { 184 {
185 matrix.a = a; 185 matrix.a = a;
186 matrix.b = b; 186 matrix.b = b;
187 matrix.c = c; 187 matrix.c = c;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 shouldBe("matrix.f", "10"); 296 shouldBe("matrix.f", "10");
297 297
298 ctx.fillStyle = 'green'; 298 ctx.fillStyle = 'green';
299 ctx.fillRect(-100, -10, 100, 100); 299 ctx.fillRect(-100, -10, 100, 100);
300 300
301 imageData = ctx.getImageData(1, 1, 98, 98); 301 imageData = ctx.getImageData(1, 1, 98, 98);
302 imgdata = imageData.data; 302 imgdata = imageData.data;
303 shouldBe("imgdata[4]", "0"); 303 shouldBe("imgdata[4]", "0");
304 shouldBe("imgdata[5]", "128"); 304 shouldBe("imgdata[5]", "128");
305 shouldBe("imgdata[6]", "0"); 305 shouldBe("imgdata[6]", "0");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698