OLD | NEW |
1 #library('SVG2Test'); | 1 #library('SVG2Test'); |
2 #import('../../../../lib/unittest/unittest_dom.dart'); | 2 #import('../../../../lib/unittest/unittest.dart'); |
| 3 #import('../../../../lib/unittest/dom_config.dart'); |
3 #import('dart:dom'); | 4 #import('dart:dom'); |
4 | 5 |
5 // Test that SVG elements explicitly implement the IDL interfaces (is-checks | 6 // Test that SVG elements explicitly implement the IDL interfaces (is-checks |
6 // only, see SVGTest3 for behavioural tests). | 7 // only, see SVGTest3 for behavioural tests). |
7 | 8 |
8 main() { | 9 main() { |
9 | 10 |
10 insertTestDiv() { | 11 insertTestDiv() { |
11 var element = document.createElement('div'); | 12 var element = document.createElement('div'); |
12 element.innerHTML = @''' | 13 element.innerHTML = @''' |
13 <svg id='svg1' width='200' height='100'> | 14 <svg id='svg1' width='200' height='100'> |
14 <rect id='rect1' x='10' y='20' width='130' height='40' rx='5'fill='blue'></rect> | 15 <rect id='rect1' x='10' y='20' width='130' height='40' rx='5'fill='blue'></rect> |
15 </svg> | 16 </svg> |
16 '''; | 17 '''; |
17 document.body.appendChild(element); | 18 document.body.appendChild(element); |
18 return element; | 19 return element; |
19 } | 20 } |
20 | 21 |
21 forLayoutTests(); | 22 useDomConfiguration(isLayoutTest: true); |
22 | 23 |
23 test('rect_isChecks', () { | 24 test('rect_isChecks', () { |
24 var div = insertTestDiv(); | 25 var div = insertTestDiv(); |
25 var r = document.getElementById('rect1'); | 26 var r = document.getElementById('rect1'); |
26 | 27 |
27 // Direct inheritance chain | 28 // Direct inheritance chain |
28 Expect.isTrue(r is SVGElement); | 29 Expect.isTrue(r is SVGElement); |
29 Expect.isTrue(r is Element); | 30 Expect.isTrue(r is Element); |
30 Expect.isTrue(r is Node); | 31 Expect.isTrue(r is Node); |
31 | 32 |
32 // Other implemented interfaces. | 33 // Other implemented interfaces. |
33 Expect.isTrue(r is SVGTests); | 34 Expect.isTrue(r is SVGTests); |
34 Expect.isTrue(r is SVGLangSpace); | 35 Expect.isTrue(r is SVGLangSpace); |
35 Expect.isTrue(r is SVGExternalResourcesRequired); | 36 Expect.isTrue(r is SVGExternalResourcesRequired); |
36 Expect.isTrue(r is SVGStylable); | 37 Expect.isTrue(r is SVGStylable); |
37 Expect.isTrue(r is SVGTransformable); | 38 Expect.isTrue(r is SVGTransformable); |
38 Expect.isTrue(r is SVGLocatable); | 39 Expect.isTrue(r is SVGLocatable); |
39 | 40 |
40 // Interfaces not implemented. | 41 // Interfaces not implemented. |
41 Expect.isFalse(r is SVGNumber); | 42 Expect.isFalse(r is SVGNumber); |
42 Expect.isFalse(r is SVGRect); | 43 Expect.isFalse(r is SVGRect); |
43 Expect.isFalse(r is SVGSVGElement); | 44 Expect.isFalse(r is SVGSVGElement); |
44 | 45 |
45 document.body.removeChild(div); | 46 document.body.removeChild(div); |
46 }); | 47 }); |
47 } | 48 } |
OLD | NEW |