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

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

Issue 896293003: Cleanup method signatures that were incorrect due to a lack of understanding about how Dart generic… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 | « tests/html/element_classes_test.dart ('k') | tools/dom/src/shared_html.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 'package:unittest/unittest.dart'; 6 import 'package:unittest/unittest.dart';
7 import 'package:unittest/html_individual_config.dart'; 7 import 'package:unittest/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 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 group('ElementList', () { 908 group('ElementList', () {
909 // Tests for methods on the DOM class 'NodeList'. 909 // Tests for methods on the DOM class 'NodeList'.
910 // 910 //
911 // There are two interesting things that are checked here from the viewpoint 911 // There are two interesting things that are checked here from the viewpoint
912 // of the dart2js implementation of a 'native' class: 912 // of the dart2js implementation of a 'native' class:
913 // 913 //
914 // 1. Some methods are implementated from by 'Object' or 'Interceptor'; 914 // 1. Some methods are implementated from by 'Object' or 'Interceptor';
915 // some of these tests simply check that a method can be called. 915 // some of these tests simply check that a method can be called.
916 // 2. Some methods are implemented by mixins. 916 // 2. Some methods are implemented by mixins.
917 917
918 ElementList makeElementList() => 918 ElementList<Element> makeElementList() =>
919 (new Element.html("<div>Foo<br/><!--baz--><br/><br/></div>")) 919 (new Element.html("<div>Foo<br/><!--baz--><br/><br/></div>"))
920 .queryAll('br'); 920 .queryAll('br');
921 921
922 test('hashCode', () { 922 test('hashCode', () {
923 var nodes = makeElementList(); 923 var nodes = makeElementList();
924 var hash = nodes.hashCode; 924 var hash = nodes.hashCode;
925 final int N = 1000; 925 final int N = 1000;
926 int matchCount = 0; 926 int matchCount = 0;
927 for (int i = 0; i < N; i++) { 927 for (int i = 0; i < N; i++) {
928 if (makeElementList().hashCode == hash) matchCount++; 928 if (makeElementList().hashCode == hash) matchCount++;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 969
970 test('sublist', () { 970 test('sublist', () {
971 var range = makeElementList().sublist(1, 3); 971 var range = makeElementList().sublist(1, 3);
972 expect(range.length, 2); 972 expect(range.length, 2);
973 expect(range[0], isBRElement); 973 expect(range[0], isBRElement);
974 expect(range[1], isBRElement); 974 expect(range[1], isBRElement);
975 }); 975 });
976 976
977 }); 977 });
978 } 978 }
OLDNEW
« no previous file with comments | « tests/html/element_classes_test.dart ('k') | tools/dom/src/shared_html.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698