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

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

Issue 11033007: Revert "Removing ElementList (splitting out removing NodeList into a separate CL)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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/htmlcollection_test.dart ('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('NodeTest'); 5 #library('NodeTest');
6 #import('../../pkg/unittest/unittest.dart'); 6 #import('../../pkg/unittest/unittest.dart');
7 #import('../../pkg/unittest/html_config.dart'); 7 #import('../../pkg/unittest/html_config.dart');
8 #import('dart:html'); 8 #import('dart:html');
9 9
10 Node makeNode() => new Element.tag('div'); 10 Node makeNode() => new Element.tag('div');
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 Expect.equals(1, node.nodes.length); 165 Expect.equals(1, node.nodes.length);
166 }); 166 });
167 167
168 test('getRange', () { 168 test('getRange', () {
169 var node = makeNodeWithChildren(); 169 var node = makeNodeWithChildren();
170 Expect.isTrue(node.nodes.getRange(1, 2) is NodeList); 170 Expect.isTrue(node.nodes.getRange(1, 2) is NodeList);
171 }); 171 });
172 }); 172 });
173 173
174 group('_NodeList', () { 174 group('_NodeList', () {
175 List<Node> makeNodeList() => 175 NodeList makeNodeList() =>
176 makeNodeWithChildren().nodes.filter((_) => true); 176 makeNodeWithChildren().nodes.filter((_) => true);
177 177
178 test('first', () { 178 test('first', () {
179 var nodes = makeNodeList(); 179 var nodes = makeNodeList();
180 Expect.isTrue(nodes.first is Text); 180 Expect.isTrue(nodes.first is Text);
181 }); 181 });
182 182
183 test('filter', () { 183 test('filter', () {
184 var filtered = makeNodeList().filter((n) => n is BRElement); 184 var filtered = makeNodeList().filter((n) => n is BRElement);
185 Expect.equals(1, filtered.length); 185 Expect.equals(1, filtered.length);
186 Expect.isTrue(filtered[0] is BRElement); 186 Expect.isTrue(filtered[0] is BRElement);
187 Expect.isTrue(filtered is NodeList); 187 Expect.isTrue(filtered is NodeList);
188 }); 188 });
189 189
190 test('getRange', () { 190 test('getRange', () {
191 var range = makeNodeList().getRange(1, 2); 191 var range = makeNodeList().getRange(1, 2);
192 Expect.isTrue(range is NodeList); 192 Expect.isTrue(range is NodeList);
193 Expect.isTrue(range[0] is BRElement); 193 Expect.isTrue(range[0] is BRElement);
194 Expect.isTrue(range[1] is Comment); 194 Expect.isTrue(range[1] is Comment);
195 }); 195 });
196 }); 196 });
197 } 197 }
OLDNEW
« no previous file with comments | « tests/html/htmlcollection_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698