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

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

Issue 12091005: Revert "Adding supported checks for Element.matches." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
605 group('matches', () { 599 group('matches', () {
606 test('matches', () { 600 test('matches', () {
607 var expectation = Element.supportsMatches ? returnsNormally : throws; 601 var element = new DivElement();
608 expect(() { 602 element.classes.add('test');
609 var element = new DivElement();
610 element.classes.add('test');
611 603
612 expect(element.matches('div'), true); 604 expect(element.matches('div'), true);
613 expect(element.matches('span'), false); 605 expect(element.matches('span'), false);
614 expect(element.matches('.test'), true); 606 expect(element.matches('.test'), true);
615 }, expectation);
616 }); 607 });
617 }); 608 });
618 609
619 group('queryAll', () { 610 group('queryAll', () {
620 List<Element> getQueryAll() { 611 List<Element> getQueryAll() {
621 return new Element.html(""" 612 return new Element.html("""
622 <div> 613 <div>
623 <hr/> 614 <hr/>
624 <a class='q' href='http://dartlang.org'>Dart!</a> 615 <a class='q' href='http://dartlang.org'>Dart!</a>
625 <p> 616 <p>
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 }); 734 });
744 735
745 test('getRange', () { 736 test('getRange', () {
746 var range = makeElList().getRange(1, 2); 737 var range = makeElList().getRange(1, 2);
747 expect(range, isElementList); 738 expect(range, isElementList);
748 expect(range[0], isImageElement); 739 expect(range[0], isImageElement);
749 expect(range[1], isInputElement); 740 expect(range[1], isInputElement);
750 }); 741 });
751 }); 742 });
752 } 743 }
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