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

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

Issue 12040101: Adding supported checks for Element.matches. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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/dartium/html_dartium.dart ('k') | tests/html/html.status » ('j') | 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 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 expect(el.children.removeLast(), isImageElement); 589 expect(el.children.removeLast(), isImageElement);
590 expect(el.children.length, 1); 590 expect(el.children.length, 1);
591 }); 591 });
592 592
593 test('getRange', () { 593 test('getRange', () {
594 var el = makeElementWithChildren(); 594 var el = makeElementWithChildren();
595 expect(el.children.getRange(1, 1), isElementList); 595 expect(el.children.getRange(1, 1), isElementList);
596 }); 596 });
597 }); 597 });
598 598
599 group('supported_matches', () {
600 test('supported', () {
601 expect(Element.supportsMatches, true);
602 });
603 });
604
599 group('matches', () { 605 group('matches', () {
600 test('matches', () { 606 test('matches', () {
601 var element = new DivElement(); 607 var expectation = Element.supportsMatches ? returnsNormally : throws;
602 element.classes.add('test'); 608 expect(() {
609 var element = new DivElement();
610 element.classes.add('test');
603 611
604 expect(element.matches('div'), true); 612 expect(element.matches('div'), true);
605 expect(element.matches('span'), false); 613 expect(element.matches('span'), false);
606 expect(element.matches('.test'), true); 614 expect(element.matches('.test'), true);
615 }, expectation);
607 }); 616 });
608 }); 617 });
609 618
610 group('queryAll', () { 619 group('queryAll', () {
611 List<Element> getQueryAll() { 620 List<Element> getQueryAll() {
612 return new Element.html(""" 621 return new Element.html("""
613 <div> 622 <div>
614 <hr/> 623 <hr/>
615 <a class='q' href='http://dartlang.org'>Dart!</a> 624 <a class='q' href='http://dartlang.org'>Dart!</a>
616 <p> 625 <p>
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 }); 743 });
735 744
736 test('getRange', () { 745 test('getRange', () {
737 var range = makeElList().getRange(1, 2); 746 var range = makeElList().getRange(1, 2);
738 expect(range, isElementList); 747 expect(range, isElementList);
739 expect(range[0], isImageElement); 748 expect(range[0], isImageElement);
740 expect(range[1], isInputElement); 749 expect(range[1], isInputElement);
741 }); 750 });
742 }); 751 });
743 } 752 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698