OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import 'dart:html'; | 5 import 'dart:html'; |
6 import 'dart:typed_data'; | 6 import 'dart:typed_data'; |
7 | 7 |
8 import 'package:minitest/minitest.dart'; | 8 import 'package:expect/minitest.dart'; |
9 | 9 |
10 // We have aliased the legacy type CanvasPixelArray with the new type | 10 // We have aliased the legacy type CanvasPixelArray with the new type |
11 // Uint8ClampedArray by mapping the CanvasPixelArray type tag to | 11 // Uint8ClampedArray by mapping the CanvasPixelArray type tag to |
12 // Uint8ClampedArray. It is not a perfect match since CanvasPixelArray is | 12 // Uint8ClampedArray. It is not a perfect match since CanvasPixelArray is |
13 // missing the ArrayBufferView members. These should appear to be null. | 13 // missing the ArrayBufferView members. These should appear to be null. |
14 | 14 |
15 var inscrutable; | 15 var inscrutable; |
16 | 16 |
17 main() { | 17 main() { |
18 inscrutable = (x) => x; | 18 inscrutable = (x) => x; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 }); | 106 }); |
107 }); | 107 }); |
108 } | 108 } |
109 | 109 |
110 void checkPixel(List<int> data, int offset, List<int> rgba) { | 110 void checkPixel(List<int> data, int offset, List<int> rgba) { |
111 offset *= 4; | 111 offset *= 4; |
112 for (var i = 0; i < 4; ++i) { | 112 for (var i = 0; i < 4; ++i) { |
113 expect(rgba[i], equals(data[offset + i])); | 113 expect(rgba[i], equals(data[offset + i])); |
114 } | 114 } |
115 } | 115 } |
OLD | NEW |