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