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

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

Issue 14619013: Explicitly implementing some DOM iterable APIs for performance (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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/web_sql/dartium/web_sql_dartium.dart ('k') | tools/dom/scripts/systemhtml.py » ('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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 expect(node.nodes[7], isInputElement); 111 expect(node.nodes[7], isInputElement);
112 expect(node.nodes[8], isComment); 112 expect(node.nodes[8], isComment);
113 }); 113 });
114 }); 114 });
115 115
116 group('nodes', () { 116 group('nodes', () {
117 test('is a NodeList', () { 117 test('is a NodeList', () {
118 expect(makeNodeWithChildren().nodes, isNodeList); 118 expect(makeNodeWithChildren().nodes, isNodeList);
119 }); 119 });
120 120
121 test('indexer', () {
122 var node = new DivElement();
123 expect(() {
124 node.nodes[0];
125 }, throwsRangeError);
126
127 expect(() {
128 node.nodes[-1];
129 }, throwsRangeError);
130 });
131
121 test('first', () { 132 test('first', () {
122 var node = makeNodeWithChildren(); 133 var node = makeNodeWithChildren();
123 expect(node.nodes.first, isText); 134 expect(node.nodes.first, isText);
124 135
125 node = new DivElement(); 136 node = new DivElement();
126 expect(() { 137 expect(() {
127 node = node.nodes.first; 138 node = node.nodes.first;
128 }, throwsStateError); 139 }, throwsStateError);
129 }); 140 });
130 141
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 }); 368 });
358 369
359 test('TreeWalker', () { 370 test('TreeWalker', () {
360 var root = makeNodeWithChildren(); 371 var root = makeNodeWithChildren();
361 var treeWalker = new TreeWalker(root, NodeFilter.SHOW_COMMENT); 372 var treeWalker = new TreeWalker(root, NodeFilter.SHOW_COMMENT);
362 expect(treeWalker.nextNode(), isComment); 373 expect(treeWalker.nextNode(), isComment);
363 expect(treeWalker.nextNode(), isNull); 374 expect(treeWalker.nextNode(), isNull);
364 }); 375 });
365 }); 376 });
366 } 377 }
OLDNEW
« no previous file with comments | « sdk/lib/web_sql/dartium/web_sql_dartium.dart ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698