OLD | NEW |
1 #library('CanvasUsingHtmlTest'); | 1 #library('CanvasUsingHtmlTest'); |
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:html', prefix: 'html'); | 4 #import('dart:html', prefix: 'html'); |
5 #import('dart:dom'); | 5 #import('dart:dom'); |
6 | 6 |
7 // Version of Canvas test that implicitly uses dart:html library via unittests. | 7 // Version of Canvas test that implicitly uses dart:html library via unittests. |
8 | 8 |
9 main() { | 9 main() { |
10 HTMLCanvasElement canvas; | 10 HTMLCanvasElement canvas; |
11 CanvasRenderingContext2D context; | 11 CanvasRenderingContext2D context; |
12 | 12 |
13 canvas = document.createElement('canvas'); | 13 canvas = document.createElement('canvas'); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 ImageData image = context.createImageData(canvas.width, | 48 ImageData image = context.createImageData(canvas.width, |
49 canvas.height); | 49 canvas.height); |
50 Uint8ClampedArray bytes = image.data; | 50 Uint8ClampedArray bytes = image.data; |
51 | 51 |
52 // FIXME: uncomment when numeric index getters are supported. | 52 // FIXME: uncomment when numeric index getters are supported. |
53 //var byte = bytes[0]; | 53 //var byte = bytes[0]; |
54 | 54 |
55 Expect.equals(40000, bytes.length); | 55 Expect.equals(40000, bytes.length); |
56 }); | 56 }); |
57 } | 57 } |
OLD | NEW |