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; | 5 library canvas_rendering_context_2d_test; |
6 import '../../pkg/unittest/lib/unittest.dart'; | 6 import '../../pkg/unittest/lib/unittest.dart'; |
7 import '../../pkg/unittest/lib/html_config.dart'; | 7 import '../../pkg/unittest/lib/html_config.dart'; |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 import 'dart:math'; | 9 import 'dart:math'; |
10 | 10 |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
523 checkPixel(readPixel(69, 69), [0, 0, 255, 255]); | 523 checkPixel(readPixel(69, 69), [0, 0, 255, 255]); |
524 expectPixelFilled(50, 50); | 524 expectPixelFilled(50, 50); |
525 expectPixelFilled(55, 55); | 525 expectPixelFilled(55, 55); |
526 expectPixelFilled(59, 59); | 526 expectPixelFilled(59, 59); |
527 expectPixelFilled(60, 60); | 527 expectPixelFilled(60, 60); |
528 expectPixelFilled(69, 69); | 528 expectPixelFilled(69, 69); |
529 expectPixelUnfilled(70, 70); | 529 expectPixelUnfilled(70, 70); |
530 expectPixelUnfilled(0, 0); | 530 expectPixelUnfilled(0, 0); |
531 expectPixelUnfilled(80, 80); | 531 expectPixelUnfilled(80, 80); |
532 }); | 532 }); |
533 | |
534 test('createImageData', () { | |
535 var imageData = context.createImageData(15, 15); | |
536 expect(imageData.width, 15); | |
537 expect(imageData.height, 15); | |
538 | |
539 var other = context.createImageDataFromData(imageData); | |
Andrei Mouravski
2013/03/20 22:42:08
I'd love to see this actually checking the data.
blois
2013/03/20 22:47:56
The data should be all 0 in all cases- critical po
Andrei Mouravski
2013/03/20 22:50:19
I guess the part I'd like to see is make an imageD
| |
540 expect(other.width, 15); | |
541 expect(other.height, 15); | |
542 }); | |
533 }); | 543 }); |
534 } | 544 } |
OLD | NEW |