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

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

Issue 12510003: Fixing a number of dart:html analyzer issues (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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/html_common/lists.dart ('k') | tools/dom/src/CssClassSet.dart » ('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: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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 expect(el.children[1], isHRElement); 432 expect(el.children[1], isHRElement);
433 expect(el.children[2], isInputElement); 433 expect(el.children[2], isInputElement);
434 }); 434 });
435 435
436 test('add', () { 436 test('add', () {
437 var el = makeElement(); 437 var el = makeElement();
438 el.children.add(new Element.tag('hr')); 438 el.children.add(new Element.tag('hr'));
439 expect(el.children.last, isHRElement); 439 expect(el.children.last, isHRElement);
440 }); 440 });
441 441
442 test('addLast', () {
443 var el = makeElement();
444 el.children.addLast(new Element.tag('hr'));
445 expect(el.children.last, isHRElement);
446 });
447
448 test('iterator', () { 442 test('iterator', () {
449 var els = []; 443 var els = [];
450 var el = makeElementWithChildren(); 444 var el = makeElementWithChildren();
451 for (var subel in el.children) { 445 for (var subel in el.children) {
452 els.add(subel); 446 els.add(subel);
453 } 447 }
454 expect(els[0], isBRElement); 448 expect(els[0], isBRElement);
455 expect(els[1], isImageElement); 449 expect(els[1], isImageElement);
456 expect(els[2], isInputElement); 450 expect(els[2], isInputElement);
457 }); 451 });
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 expect(els[1], isSpanElement); 581 expect(els[1], isSpanElement);
588 expect(els[2], isHRElement); 582 expect(els[2], isHRElement);
589 }); 583 });
590 584
591 test('getRange', () { 585 test('getRange', () {
592 expect(getQueryAll().getRange(1, 1) is List<Element>, isTrue); 586 expect(getQueryAll().getRange(1, 1) is List<Element>, isTrue);
593 }); 587 });
594 588
595 testUnsupported('[]=', () => getQueryAll()[1] = new Element.tag('br')); 589 testUnsupported('[]=', () => getQueryAll()[1] = new Element.tag('br'));
596 testUnsupported('add', () => getQueryAll().add(new Element.tag('br'))); 590 testUnsupported('add', () => getQueryAll().add(new Element.tag('br')));
597 testUnsupported('addLast', () =>
598 getQueryAll().addLast(new Element.tag('br')));
599 591
600 testUnsupported('addAll', () { 592 testUnsupported('addAll', () {
601 getQueryAll().addAll([ 593 getQueryAll().addAll([
602 new Element.tag('span'), 594 new Element.tag('span'),
603 new Element.tag('a'), 595 new Element.tag('a'),
604 new Element.tag('h1') 596 new Element.tag('h1')
605 ]); 597 ]);
606 }); 598 });
607 599
608 testUnsupported('sort', () => getQueryAll().sort((a1, a2) => true)); 600 testUnsupported('sort', () => getQueryAll().sort((a1, a2) => true));
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 }); 633 });
642 634
643 test('getRange', () { 635 test('getRange', () {
644 var range = makeElList().getRange(1, 2); 636 var range = makeElList().getRange(1, 2);
645 expect(range, isElementList); 637 expect(range, isElementList);
646 expect(range[0], isImageElement); 638 expect(range[0], isImageElement);
647 expect(range[1], isInputElement); 639 expect(range[1], isInputElement);
648 }); 640 });
649 }); 641 });
650 } 642 }
OLDNEW
« no previous file with comments | « sdk/lib/html/html_common/lists.dart ('k') | tools/dom/src/CssClassSet.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698