| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 // Put universally passing event constructors in this file. |
| 6 // Move constructors that fail on some configuration to their own |
| 7 // element_constructor_foo_test.dart file. |
| 8 |
| 9 #library('ElementConstructorTest'); |
| 10 #import('../../lib/unittest/unittest.dart'); |
| 11 #import('../../lib/unittest/html_config.dart'); |
| 12 #import('dart:html'); |
| 13 |
| 14 main() { |
| 15 useHtmlConfiguration(); |
| 16 |
| 17 test('anchor1', () { |
| 18 var e = new AnchorElement(); |
| 19 Expect.isTrue(e is AnchorElement); |
| 20 }); |
| 21 |
| 22 test('anchor2', () { |
| 23 var e = new AnchorElement(href: '#blah'); |
| 24 Expect.isTrue(e is AnchorElement); |
| 25 Expect.isTrue(e.href.endsWith('#blah')); |
| 26 }); |
| 27 |
| 28 test('area', () { |
| 29 var e = new AreaElement(); |
| 30 Expect.isTrue(e is AreaElement); |
| 31 }); |
| 32 |
| 33 // AudioElement tested in audioelement_test.dart |
| 34 |
| 35 test('div', () { |
| 36 var e = new DivElement(); |
| 37 Expect.isTrue(e is DivElement); |
| 38 }); |
| 39 |
| 40 test('canvas1', () { |
| 41 var e = new CanvasElement(); |
| 42 Expect.isTrue(e is CanvasElement); |
| 43 }); |
| 44 |
| 45 test('canvas2', () { |
| 46 var e = new CanvasElement(height: 100, width: 200); |
| 47 Expect.isTrue(e is CanvasElement); |
| 48 Expect.equals(200, e.width); |
| 49 Expect.equals(100, e.height); |
| 50 }); |
| 51 |
| 52 test('p', () { |
| 53 var e = new ParagraphElement(); |
| 54 Expect.isTrue(e is ParagraphElement); |
| 55 }); |
| 56 |
| 57 test('span', () { |
| 58 var e = new SpanElement(); |
| 59 Expect.isTrue(e is SpanElement); |
| 60 }); |
| 61 } |
| OLD | NEW |