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

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

Issue 12407005: Adding tests for Element & Node lists insert method. (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 | « tests/html/element_test.dart ('k') | tools/dom/templates/html/impl/impl_Element.darttemplate » ('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 NodeTest; 5 library NodeTest;
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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 220
221 b.nodes.addAll(a.children); 221 b.nodes.addAll(a.children);
222 expect(a.children.length, 0); 222 expect(a.children.length, 0);
223 expect(b.children.length, childrenLength); 223 expect(b.children.length, childrenLength);
224 224
225 a.nodes.addAll(b.nodes); 225 a.nodes.addAll(b.nodes);
226 expect(b.nodes.length, 0); 226 expect(b.nodes.length, 0);
227 expect(a.nodes.length, nodesLength); 227 expect(a.nodes.length, nodesLength);
228 }); 228 });
229 229
230 test('insert', () {
231 var node = new DivElement();
232 node.nodes.insert(0, new BRElement());
233 expect(node.nodes[0], isBRElement);
234 node.nodes.insert(0, new HRElement());
235 expect(node.nodes[0], isHRElement);
236 node.nodes.insert(1, new ImageElement());
237 expect(node.nodes[1], isImageElement);
238 node.nodes.insert(node.nodes.length, new InputElement());
239 expect(node.nodes.last, isInputElement);
240 });
241
230 test('clear', () { 242 test('clear', () {
231 var node = makeNodeWithChildren(); 243 var node = makeNodeWithChildren();
232 node.nodes.clear(); 244 node.nodes.clear();
233 expect(node.nodes, []); 245 expect(node.nodes, []);
234 }); 246 });
235 247
236 test('removeLast', () { 248 test('removeLast', () {
237 var node = makeNodeWithChildren(); 249 var node = makeNodeWithChildren();
238 expect(node.nodes.removeLast(), isComment); 250 expect(node.nodes.removeLast(), isComment);
239 expect(node.nodes.length, 2); 251 expect(node.nodes.length, 2);
(...skipping 24 matching lines...) Expand all
264 }); 276 });
265 277
266 test('getRange', () { 278 test('getRange', () {
267 var range = makeNodeList().getRange(1, 2); 279 var range = makeNodeList().getRange(1, 2);
268 expect(range, isNodeList); 280 expect(range, isNodeList);
269 expect(range[0], isBRElement); 281 expect(range[0], isBRElement);
270 expect(range[1], isComment); 282 expect(range[1], isComment);
271 }); 283 });
272 }); 284 });
273 } 285 }
OLDNEW
« no previous file with comments | « tests/html/element_test.dart ('k') | tools/dom/templates/html/impl/impl_Element.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698