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/unittest.dart'); | 6 #import('../../pkg/unittest/unittest.dart'); |
7 #import('../../pkg/unittest/html_config.dart'); | 7 #import('../../pkg/unittest/html_config.dart'); |
8 #import('dart:html'); | 8 #import('dart:html'); |
9 | 9 |
10 expectLargeRect(ClientRect rect) { | 10 expectLargeRect(ClientRect rect) { |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 Expect.isFalse(el.elements.every((n) => n is InputElement)); | 523 Expect.isFalse(el.elements.every((n) => n is InputElement)); |
524 }); | 524 }); |
525 | 525 |
526 test('some', () { | 526 test('some', () { |
527 var el = makeElementWithChildren(); | 527 var el = makeElementWithChildren(); |
528 Expect.isTrue(el.elements.some((n) => n is InputElement)); | 528 Expect.isTrue(el.elements.some((n) => n is InputElement)); |
529 Expect.isFalse(el.elements.some((n) => n is SVGElement)); | 529 Expect.isFalse(el.elements.some((n) => n is SVGElement)); |
530 }); | 530 }); |
531 | 531 |
532 test('isEmpty', () { | 532 test('isEmpty', () { |
533 Expect.isTrue(makeElement().elements.isEmpty()); | 533 Expect.isTrue(makeElement().elements.isEmpty); |
534 Expect.isFalse(makeElementWithChildren().elements.isEmpty()); | 534 Expect.isFalse(makeElementWithChildren().elements.isEmpty); |
535 }); | 535 }); |
536 | 536 |
537 test('length', () { | 537 test('length', () { |
538 Expect.equals(0, makeElement().elements.length); | 538 Expect.equals(0, makeElement().elements.length); |
539 Expect.equals(3, makeElementWithChildren().elements.length); | 539 Expect.equals(3, makeElementWithChildren().elements.length); |
540 }); | 540 }); |
541 | 541 |
542 test('[]', () { | 542 test('[]', () { |
543 var el = makeElementWithChildren(); | 543 var el = makeElementWithChildren(); |
544 Expect.isTrue(el.elements[0] is BRElement); | 544 Expect.isTrue(el.elements[0] is BRElement); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 Expect.isFalse(el.every((n) => n is SpanElement)); | 665 Expect.isFalse(el.every((n) => n is SpanElement)); |
666 }); | 666 }); |
667 | 667 |
668 test('some', () { | 668 test('some', () { |
669 var el = getQueryAll(); | 669 var el = getQueryAll(); |
670 Expect.isTrue(el.some((n) => n is SpanElement)); | 670 Expect.isTrue(el.some((n) => n is SpanElement)); |
671 Expect.isFalse(el.some((n) => n is SVGElement)); | 671 Expect.isFalse(el.some((n) => n is SVGElement)); |
672 }); | 672 }); |
673 | 673 |
674 test('isEmpty', () { | 674 test('isEmpty', () { |
675 Expect.isTrue(getEmptyQueryAll().isEmpty()); | 675 Expect.isTrue(getEmptyQueryAll().isEmpty); |
676 Expect.isFalse(getQueryAll().isEmpty()); | 676 Expect.isFalse(getQueryAll().isEmpty); |
677 }); | 677 }); |
678 | 678 |
679 test('length', () { | 679 test('length', () { |
680 Expect.equals(0, getEmptyQueryAll().length); | 680 Expect.equals(0, getEmptyQueryAll().length); |
681 Expect.equals(3, getQueryAll().length); | 681 Expect.equals(3, getQueryAll().length); |
682 }); | 682 }); |
683 | 683 |
684 test('[]', () { | 684 test('[]', () { |
685 var els = getQueryAll(); | 685 var els = getQueryAll(); |
686 Expect.isTrue(els[0] is AnchorElement); | 686 Expect.isTrue(els[0] is AnchorElement); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 }); | 739 }); |
740 | 740 |
741 test('getRange', () { | 741 test('getRange', () { |
742 var range = makeElList().getRange(1, 2); | 742 var range = makeElList().getRange(1, 2); |
743 Expect.isTrue(range is List<Element>); | 743 Expect.isTrue(range is List<Element>); |
744 Expect.isTrue(range[0] is ImageElement); | 744 Expect.isTrue(range[0] is ImageElement); |
745 Expect.isTrue(range[1] is InputElement); | 745 Expect.isTrue(range[1] is InputElement); |
746 }); | 746 }); |
747 }); | 747 }); |
748 } | 748 } |
OLD | NEW |