| 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; import 'package:unittest/unittest.dart
'; |
| 6 import '../../pkg/unittest/lib/html_individual_config.dart'; | 6 import 'package:unittest/html_individual_config.dart'; |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 import 'dart:math'; | 8 import 'dart:math'; |
| 9 | 9 |
| 10 // Some rounding errors in the browsers. | 10 // Some rounding errors in the browsers. |
| 11 checkPixel(List<int> pixel, List<int> expected) { | 11 checkPixel(List<int> pixel, List<int> expected) { |
| 12 expect(pixel[0], closeTo(expected[0], 2)); | 12 expect(pixel[0], closeTo(expected[0], 2)); |
| 13 expect(pixel[1], closeTo(expected[1], 2)); | 13 expect(pixel[1], closeTo(expected[1], 2)); |
| 14 expect(pixel[2], closeTo(expected[2], 2)); | 14 expect(pixel[2], closeTo(expected[2], 2)); |
| 15 expect(pixel[3], closeTo(expected[3], 2)); | 15 expect(pixel[3], closeTo(expected[3], 2)); |
| 16 } | 16 } |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 | 738 |
| 739 // The box does not draw after 20 pixels. | 739 // The box does not draw after 20 pixels. |
| 740 expectPixelUnfilled(x - 10, y); | 740 expectPixelUnfilled(x - 10, y); |
| 741 expectPixelUnfilled(x + maxWidth + 1, y); | 741 expectPixelUnfilled(x + maxWidth + 1, y); |
| 742 expectPixelUnfilled(x + maxWidth + 20, y); | 742 expectPixelUnfilled(x + maxWidth + 20, y); |
| 743 expectPixelFilled(x, y); | 743 expectPixelFilled(x, y); |
| 744 expectPixelFilled(x + 10, y); | 744 expectPixelFilled(x + 10, y); |
| 745 }); | 745 }); |
| 746 }); | 746 }); |
| 747 } | 747 } |
| OLD | NEW |