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 '../../pkg/unittest/lib/unittes
t.dart'; |
6 import '../../pkg/unittest/lib/html_individual_config.dart'; | 6 import '../../pkg/unittest/lib/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. |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // TODO(antonm): in Dartium ArgumentError should be thrown too. | 236 // TODO(antonm): in Dartium ArgumentError should be thrown too. |
237 expect(() => context.putImageData(expectedData, 0, 0, 1), | 237 expect(() => context.putImageData(expectedData, 0, 0, 1), |
238 throws); | 238 throws); |
239 expect(() => context.putImageData(expectedData, 0, 0, 1, 1), | 239 expect(() => context.putImageData(expectedData, 0, 0, 1, 1), |
240 throws); | 240 throws); |
241 expect(() => context.putImageData(expectedData, 0, 0, 1, 1, 5), | 241 expect(() => context.putImageData(expectedData, 0, 0, 1, 1, 5), |
242 throws); | 242 throws); |
243 }); | 243 }); |
244 }); | 244 }); |
245 | 245 |
| 246 group('linedash', () { |
| 247 setUp(setupFunc); |
| 248 tearDown(tearDownFunc); |
| 249 |
| 250 test('setLineDash', () { |
| 251 expect(context.getLineDash(), equals([])); |
| 252 var old = context.getLineDash(); |
| 253 context.setLineDash(old); |
| 254 }); |
| 255 }); |
| 256 |
246 group('arc', () { | 257 group('arc', () { |
247 setUp(setupFunc); | 258 setUp(setupFunc); |
248 tearDown(tearDownFunc); | 259 tearDown(tearDownFunc); |
249 | 260 |
250 test('default arc should be clockwise', () { | 261 test('default arc should be clockwise', () { |
251 context.beginPath(); | 262 context.beginPath(); |
252 final r = 10; | 263 final r = 10; |
253 | 264 |
254 // Center of arc. | 265 // Center of arc. |
255 final cx = 20; | 266 final cx = 20; |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 | 749 |
739 // The box does not draw after 20 pixels. | 750 // The box does not draw after 20 pixels. |
740 expectPixelUnfilled(x - 10, y); | 751 expectPixelUnfilled(x - 10, y); |
741 expectPixelUnfilled(x + maxWidth + 1, y); | 752 expectPixelUnfilled(x + maxWidth + 1, y); |
742 expectPixelUnfilled(x + maxWidth + 20, y); | 753 expectPixelUnfilled(x + maxWidth + 20, y); |
743 expectPixelFilled(x, y); | 754 expectPixelFilled(x, y); |
744 expectPixelFilled(x + 10, y); | 755 expectPixelFilled(x + 10, y); |
745 }); | 756 }); |
746 }); | 757 }); |
747 } | 758 } |
OLD | NEW |