| Index: tests/html/canvasrenderingcontext2d_test.dart
|
| diff --git a/tests/html/canvasrenderingcontext2d_test.dart b/tests/html/canvasrenderingcontext2d_test.dart
|
| index da9338b8ad2c12a451be3ec10fd6f82b1a66baab..d861500b9cbff87350c92c6ae05a20cb9a141368 100644
|
| --- a/tests/html/canvasrenderingcontext2d_test.dart
|
| +++ b/tests/html/canvasrenderingcontext2d_test.dart
|
| @@ -674,4 +674,44 @@ main() {
|
| //var pattern2 = context.createPatternFromImage(new ImageElement(), '');
|
| });
|
| });
|
| +
|
| + group('fillText', () {
|
| + setUp(setupFunc);
|
| + tearDown(tearDownFunc);
|
| +
|
| + test('with maxWidth defined', () {
|
| + context.font = '40pt Garamond';
|
| + context.fillStyle = 'blue';
|
| +
|
| + // Draw a blue box that's at most 20 pixels wide.
|
| + context.fillText('█', 50, 50, 20);
|
| +
|
| + checkPixel(readPixel(50, 50), [0, 0, 255, 255]);
|
| + checkPixel(readPixel(60, 50), [0, 0, 255, 255]);
|
| +
|
| + // The box does not draw after 20 pixels.
|
| + expectPixelUnfilled(40, 50);
|
| + expectPixelUnfilled(71, 50);
|
| + expectPixelUnfilled(90, 50);
|
| + expectPixelFilled(50, 50);
|
| + expectPixelFilled(60, 50);
|
| + });
|
| +
|
| + test('with maxWidth null', () {
|
| + context.font = '40pt Garamond';
|
| + context.fillStyle = 'blue';
|
| +
|
| + // Draw a blue box with null maxWidth.
|
| + context.fillText('█', 50, 50, null);
|
| +
|
| + checkPixel(readPixel(50, 50), [0, 0, 255, 255]);
|
| + checkPixel(readPixel(60, 50), [0, 0, 255, 255]);
|
| +
|
| + expectPixelUnfilled(40, 50);
|
| + expectPixelUnfilled(90, 50);
|
| + expectPixelFilled(50, 50);
|
| + expectPixelFilled(60, 50);
|
| + expectPixelFilled(70, 50);
|
| + });
|
| + });
|
| }
|
|
|