Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: tests/html/element_test.dart

Issue 11665030: Fixing Element.matches to be cross-platform and follow latest spec. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Adding experimental annotation. Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/html/templates/html/impl/impl_Element.darttemplate ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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:html'; 8 import 'dart:html';
9 import 'dart:svg' as svg; 9 import 'dart:svg' as svg;
10 10
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 expect(el.children.removeLast(), isImageElement); 639 expect(el.children.removeLast(), isImageElement);
640 expect(el.children.length, 1); 640 expect(el.children.length, 1);
641 }); 641 });
642 642
643 test('getRange', () { 643 test('getRange', () {
644 var el = makeElementWithChildren(); 644 var el = makeElementWithChildren();
645 expect(el.children.getRange(1, 1), isElementList); 645 expect(el.children.getRange(1, 1), isElementList);
646 }); 646 });
647 }); 647 });
648 648
649 group('matches', () {
650 test('matches', () {
651 var element = new DivElement();
652 element.classes.add('test');
653
654 expect(element.matches('div'), true);
655 expect(element.matches('span'), false);
656 expect(element.matches('.test'), true);
657 });
658 });
659
649 group('queryAll', () { 660 group('queryAll', () {
650 List<Element> getQueryAll() { 661 List<Element> getQueryAll() {
651 return new Element.html(""" 662 return new Element.html("""
652 <div> 663 <div>
653 <hr/> 664 <hr/>
654 <a class='q' href='http://dartlang.org'>Dart!</a> 665 <a class='q' href='http://dartlang.org'>Dart!</a>
655 <p> 666 <p>
656 <span class='q'>Hello</span>, 667 <span class='q'>Hello</span>,
657 <em>world</em>! 668 <em>world</em>!
658 </p> 669 </p>
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 }); 784 });
774 785
775 test('getRange', () { 786 test('getRange', () {
776 var range = makeElList().getRange(1, 2); 787 var range = makeElList().getRange(1, 2);
777 expect(range, isElementList); 788 expect(range, isElementList);
778 expect(range[0], isImageElement); 789 expect(range[0], isImageElement);
779 expect(range[1], isInputElement); 790 expect(range[1], isInputElement);
780 }); 791 });
781 }); 792 });
782 } 793 }
OLDNEW
« no previous file with comments | « sdk/lib/html/templates/html/impl/impl_Element.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698