OLD | NEW |
1 library CanvasTest; | 1 library CanvasTest; |
2 import '../../pkg/unittest/lib/unittest.dart'; | 2 import 'package:unittest/unittest.dart'; |
3 import '../../pkg/unittest/lib/html_config.dart'; | 3 import 'package:unittest/html_config.dart'; |
4 import 'dart:html'; | 4 import 'dart:html'; |
5 | 5 |
6 main() { | 6 main() { |
7 CanvasElement canvas; | 7 CanvasElement canvas; |
8 CanvasRenderingContext2D context; | 8 CanvasRenderingContext2D context; |
9 int width = 100; | 9 int width = 100; |
10 int height = 100; | 10 int height = 100; |
11 | 11 |
12 canvas = new CanvasElement(width:width, height:height); | 12 canvas = new CanvasElement(width:width, height:height); |
13 document.body.append(canvas); | 13 document.body.append(canvas); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 }); | 47 }); |
48 } | 48 } |
49 | 49 |
50 void checkPixel(List<int> data, int offset, List<int> rgba) | 50 void checkPixel(List<int> data, int offset, List<int> rgba) |
51 { | 51 { |
52 offset *= 4; | 52 offset *= 4; |
53 for (var i = 0; i < 4; ++i) { | 53 for (var i = 0; i < 4; ++i) { |
54 expect(data[offset + i], equals(rgba[i])); | 54 expect(data[offset + i], equals(rgba[i])); |
55 } | 55 } |
56 } | 56 } |
OLD | NEW |