| OLD | NEW |
| 1 #library('CanvasTest'); | 1 library CanvasTest; |
| 2 #import('../../pkg/unittest/unittest.dart'); | 2 import '../../pkg/unittest/lib/unittest.dart'; |
| 3 #import('../../pkg/unittest/html_config.dart'); | 3 import '../../pkg/unittest/lib/html_config.dart'; |
| 4 #import('dart:html'); | 4 import 'dart:html'; |
| 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]; | 11 Object confuseType(x) => [1, x, [x], 's'] [1]; |
| 12 | 12 |
| 13 main() { | 13 main() { |
| 14 CanvasElement canvas; | 14 CanvasElement canvas; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 43 }); | 43 }); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void checkPixel(Uint8ClampedArray data, int offset, List<int> rgba) | 46 void checkPixel(Uint8ClampedArray data, int offset, List<int> rgba) |
| 47 { | 47 { |
| 48 offset *= 4; | 48 offset *= 4; |
| 49 for (var i = 0; i < 4; ++i) { | 49 for (var i = 0; i < 4; ++i) { |
| 50 expect(rgba[i], equals(data[offset + i])); | 50 expect(rgba[i], equals(data[offset + i])); |
| 51 } | 51 } |
| 52 } | 52 } |
| OLD | NEW |