OLD | NEW |
1 #library('WrapperTest'); | 1 #library('WrapperTest'); |
2 #import('../../../testing/unittest/unittest.dart'); | 2 #import('../../../testing/unittest/unittest_dom.dart'); |
3 #import('dart:dom'); | 3 #import('dart:dom'); |
4 | 4 |
5 main() { | 5 main() { |
6 HTMLCanvasElement canvas; | 6 HTMLCanvasElement canvas; |
7 CanvasRenderingContext2D context; | 7 CanvasRenderingContext2D context; |
8 | 8 |
9 // FIXME: once main is run on content loaded, this hack won't be necessary. | 9 // FIXME: once main is run on content loaded, this hack won't be necessary. |
10 window.setTimeout(() { | 10 window.setTimeout(() { |
11 canvas = document.createElement('canvas'); | 11 canvas = document.createElement('canvas'); |
12 canvas.id = 'canvas'; | 12 canvas.id = 'canvas'; |
(...skipping 14 matching lines...) Expand all Loading... |
27 | 27 |
28 Expect.equals(42, canvas.dynamic.dartObjectLocalStorage); | 28 Expect.equals(42, canvas.dynamic.dartObjectLocalStorage); |
29 }); | 29 }); |
30 test('TypeName', () { | 30 test('TypeName', () { |
31 final element = document.getElementById('canvas'); | 31 final element = document.getElementById('canvas'); |
32 Expect.stringEquals('HTMLCanvasElement', element.typeName); | 32 Expect.stringEquals('HTMLCanvasElement', element.typeName); |
33 Expect.stringEquals('HTMLCanvasElement', canvas.dynamic.typeName); | 33 Expect.stringEquals('HTMLCanvasElement', canvas.dynamic.typeName); |
34 Expect.stringEquals('CanvasRenderingContext2D', context.dynamic.typeName); | 34 Expect.stringEquals('CanvasRenderingContext2D', context.dynamic.typeName); |
35 }); | 35 }); |
36 } | 36 } |
OLD | NEW |