| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library canvas_rendering_context_2d_test; import '../../pkg/unittest/lib/unittes
t.dart'; | 5 library canvas_rendering_context_2d_test; |
| 6 import '../../pkg/unittest/lib/html_individual_config.dart'; | 6 |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 import 'dart:math'; | 8 import 'dart:math'; |
| 9 | 9 |
| 10 import 'package:unittest/html_individual_config.dart'; |
| 11 import 'package:unittest/unittest.dart'; |
| 12 |
| 10 // Some rounding errors in the browsers. | 13 // Some rounding errors in the browsers. |
| 11 checkPixel(List<int> pixel, List<int> expected) { | 14 checkPixel(List<int> pixel, List<int> expected) { |
| 12 expect(pixel[0], closeTo(expected[0], 2)); | 15 expect(pixel[0], closeTo(expected[0], 2)); |
| 13 expect(pixel[1], closeTo(expected[1], 2)); | 16 expect(pixel[1], closeTo(expected[1], 2)); |
| 14 expect(pixel[2], closeTo(expected[2], 2)); | 17 expect(pixel[2], closeTo(expected[2], 2)); |
| 15 expect(pixel[3], closeTo(expected[3], 2)); | 18 expect(pixel[3], closeTo(expected[3], 2)); |
| 16 } | 19 } |
| 17 | 20 |
| 18 var canvas; | 21 var canvas; |
| 19 var context; | 22 var context; |
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 | 727 |
| 725 // The box does not draw after 20 pixels. | 728 // The box does not draw after 20 pixels. |
| 726 expectPixelUnfilled(x - 10, y); | 729 expectPixelUnfilled(x - 10, y); |
| 727 expectPixelUnfilled(x + maxWidth + 1, y); | 730 expectPixelUnfilled(x + maxWidth + 1, y); |
| 728 expectPixelUnfilled(x + maxWidth + 20, y); | 731 expectPixelUnfilled(x + maxWidth + 20, y); |
| 729 expectPixelFilled(x, y); | 732 expectPixelFilled(x, y); |
| 730 expectPixelFilled(x + 10, y); | 733 expectPixelFilled(x + 10, y); |
| 731 }); | 734 }); |
| 732 }); | 735 }); |
| 733 } | 736 } |
| OLD | NEW |