| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library ElementTest; | 5 library ElementTest; |
| 6 import '../../pkg/unittest/lib/unittest.dart'; | 6 import '../../pkg/unittest/lib/unittest.dart'; |
| 7 import '../../pkg/unittest/lib/html_individual_config.dart'; | 7 import '../../pkg/unittest/lib/html_individual_config.dart'; |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:html'; | 9 import 'dart:html'; |
| 10 import 'dart:svg' as svg; | 10 import 'dart:svg' as svg; |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 new Element.tag('h1') | 458 new Element.tag('h1') |
| 459 ]); | 459 ]); |
| 460 expect(el.children[0], isBRElement); | 460 expect(el.children[0], isBRElement); |
| 461 expect(el.children[1], isImageElement); | 461 expect(el.children[1], isImageElement); |
| 462 expect(el.children[2], isInputElement); | 462 expect(el.children[2], isInputElement); |
| 463 expect(el.children[3], isSpanElement); | 463 expect(el.children[3], isSpanElement); |
| 464 expect(el.children[4], isAnchorElement); | 464 expect(el.children[4], isAnchorElement); |
| 465 expect(el.children[5], isHeadingElement); | 465 expect(el.children[5], isHeadingElement); |
| 466 }); | 466 }); |
| 467 | 467 |
| 468 test('insert', () { |
| 469 var element = new DivElement(); |
| 470 element.children.insert(0, new BRElement()); |
| 471 expect(element.children[0], isBRElement); |
| 472 element.children.insert(0, new HRElement()); |
| 473 expect(element.children[0], isHRElement); |
| 474 element.children.insert(1, new ImageElement()); |
| 475 expect(element.children[1], isImageElement); |
| 476 element.children.insert(element.children.length, new InputElement()); |
| 477 expect(element.children.last, isInputElement); |
| 478 }); |
| 479 |
| 468 test('clear', () { | 480 test('clear', () { |
| 469 var el = makeElementWithChildren(); | 481 var el = makeElementWithChildren(); |
| 470 el.children.clear(); | 482 el.children.clear(); |
| 471 expect(el.children, equals([])); | 483 expect(el.children, equals([])); |
| 472 }); | 484 }); |
| 473 | 485 |
| 474 test('removeLast', () { | 486 test('removeLast', () { |
| 475 var el = makeElementWithChildren(); | 487 var el = makeElementWithChildren(); |
| 476 expect(el.children.removeLast(), isInputElement); | 488 expect(el.children.removeLast(), isInputElement); |
| 477 expect(el.children.length, 2); | 489 expect(el.children.length, 2); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 }); | 645 }); |
| 634 | 646 |
| 635 test('getRange', () { | 647 test('getRange', () { |
| 636 var range = makeElList().getRange(1, 2); | 648 var range = makeElList().getRange(1, 2); |
| 637 expect(range, isElementList); | 649 expect(range, isElementList); |
| 638 expect(range[0], isImageElement); | 650 expect(range[0], isImageElement); |
| 639 expect(range[1], isInputElement); | 651 expect(range[1], isInputElement); |
| 640 }); | 652 }); |
| 641 }); | 653 }); |
| 642 } | 654 } |
| OLD | NEW |