OLD | NEW |
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 '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:html'; | 8 import 'dart:html'; |
9 import 'dart:svg' as svg; | 9 import 'dart:svg' as svg; |
10 | 10 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 309 |
310 expect(node.nodes[0], isText); | 310 expect(node.nodes[0], isText); |
311 expect(node.nodes[1], isHRElement); | 311 expect(node.nodes[1], isHRElement); |
312 expect(node.nodes[2], isImageElement); | 312 expect(node.nodes[2], isImageElement); |
313 expect(node.nodes[3], isInputElement); | 313 expect(node.nodes[3], isInputElement); |
314 expect(node.nodes[4], isBRElement); | 314 expect(node.nodes[4], isBRElement); |
315 expect(node.nodes[5], isHRElement); | 315 expect(node.nodes[5], isHRElement); |
316 expect(node.nodes[6], isImageElement); | 316 expect(node.nodes[6], isImageElement); |
317 expect(node.nodes[7], isInputElement); | 317 expect(node.nodes[7], isInputElement); |
318 expect(node.nodes[8], isComment); | 318 expect(node.nodes[8], isComment); |
| 319 |
| 320 var d = new DivElement(); |
| 321 var ns = d.nodes; |
| 322 // `insertAll` should work when positioned at end. |
| 323 ns.insertAll(ns.length, [new HRElement()]); |
| 324 expect(ns.length, 1); |
| 325 expect(ns[0], isHRElement); |
319 }); | 326 }); |
320 | 327 |
321 testUnsupported('removeRange', () { | 328 testUnsupported('removeRange', () { |
322 makeNodeWithChildren().nodes.removeRange(0, 1); | 329 makeNodeWithChildren().nodes.removeRange(0, 1); |
323 }); | 330 }); |
324 | 331 |
325 testUnsupported('replaceRange', () { | 332 testUnsupported('replaceRange', () { |
326 makeNodeWithChildren().nodes.replaceRange(0, 1, [new InputElement()]); | 333 makeNodeWithChildren().nodes.replaceRange(0, 1, [new InputElement()]); |
327 }); | 334 }); |
328 | 335 |
(...skipping 15 matching lines...) Expand all Loading... |
344 }); | 351 }); |
345 | 352 |
346 test('TreeWalker', () { | 353 test('TreeWalker', () { |
347 var root = makeNodeWithChildren(); | 354 var root = makeNodeWithChildren(); |
348 var treeWalker = new TreeWalker(root, NodeFilter.SHOW_COMMENT); | 355 var treeWalker = new TreeWalker(root, NodeFilter.SHOW_COMMENT); |
349 expect(treeWalker.nextNode(), isComment); | 356 expect(treeWalker.nextNode(), isComment); |
350 expect(treeWalker.nextNode(), isNull); | 357 expect(treeWalker.nextNode(), isNull); |
351 }); | 358 }); |
352 }); | 359 }); |
353 } | 360 } |
OLD | NEW |