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