OLD | NEW |
1 #library('CanvasTest'); | 1 #library('CanvasTest'); |
2 #import('../../../../lib/unittest/unittest.dart'); | 2 #import('../../lib/unittest/unittest.dart'); |
3 #import('../../../../lib/unittest/dom_config.dart'); | 3 #import('../../lib/unittest/dom_config.dart'); |
4 #import('dart:dom'); | 4 #import('dart:dom'); |
5 | 5 |
6 // We have aliased the legacy type CanvasPixelArray with the new type | 6 // We have aliased the legacy type CanvasPixelArray with the new type |
7 // Uint8ClampedArray by mapping the CanvasPixelArray type tag to | 7 // Uint8ClampedArray by mapping the CanvasPixelArray type tag to |
8 // Uint8ClampedArray. It is not a perfect match since CanvasPixelArray is | 8 // Uint8ClampedArray. It is not a perfect match since CanvasPixelArray is |
9 // missing the ArrayBufferView members. These should appear to be null. | 9 // missing the ArrayBufferView members. These should appear to be null. |
10 | 10 |
11 Object confuseType(x) => [1, x, [x], 's'] [1]; // returns 'x' | 11 Object confuseType(x) => [1, x, [x], 's'] [1]; // returns 'x' |
12 | 12 |
13 main() { | 13 main() { |
(...skipping 28 matching lines...) Expand all Loading... |
42 }); | 42 }); |
43 } | 43 } |
44 | 44 |
45 void checkPixel(Uint8ClampedArray data, int offset, List<int> rgba) | 45 void checkPixel(Uint8ClampedArray data, int offset, List<int> rgba) |
46 { | 46 { |
47 offset *= 4; | 47 offset *= 4; |
48 for (var i = 0; i < 4; ++i) { | 48 for (var i = 0; i < 4; ++i) { |
49 Expect.equals(rgba[i], data[offset + i]); | 49 Expect.equals(rgba[i], data[offset + i]); |
50 } | 50 } |
51 } | 51 } |
OLD | NEW |