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

Unified Diff: tests/html/node_test.dart

Issue 23055008: Making almost all dom_ methods private. Exceptions will be addressed in a later CL. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/html/element_test.dart ('k') | tools/dom/dom.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/node_test.dart
diff --git a/tests/html/node_test.dart b/tests/html/node_test.dart
index 107055487d967329ca7340c1810577002078aca2..d142c600cf0767b4407b02a5dc2277460619edbe 100644
--- a/tests/html/node_test.dart
+++ b/tests/html/node_test.dart
@@ -335,92 +335,6 @@ main() {
});
});
- group('NodeList', () {
- // Tests for methods on the DOM class 'NodeList'.
- //
- // There are two interesting things that are checked here from the viewpoint
- // of the dart2js implementation of a 'native' class:
- //
- // 1. Some methods are implementated from by 'Object' or 'Interceptor';
- // some of these tests simply check that a method can be called.
- // 2. Some methods are implemented by mixins.
-
- List<Node> makeNodeList() =>
- (new Element.html("<div>Foo<br/><!--baz--><br/><br/></div>"))
- .$dom_getElementsByTagName('br');
- // Our WebKit-derived bindings declare getElementsByTagName as returning
- // NodeList.
- //
- // WebKit browsers returns NodeList.
- // Firefox and IE return HtmlCollection.
- // This is messed-up since the two types are disjoint. We could make
- // HtmlCollection extend NodeList but we would require better optimizations
- // to recognize when NodeList_methods can be used.
-
- test('trueNodeList', () {
- var nodes = makeNodeList();
- expect(nodes is NodeList || nodes is HtmlCollection, true);
- });
-
- test('hashCode', () {
- var nodes = makeNodeList();
- var hash = nodes.hashCode;
- final int N = 1000;
- int matchCount = 0;
- for (int i = 0; i < N; i++) {
- if (makeNodeList().hashCode == hash) matchCount++;
- }
- expect(matchCount, lessThan(N));
- });
-
- test('operator==', () {
- var a = [makeNodeList(), makeNodeList(), null];
- for (int i = 0; i < a.length; i++) {
- for (int j = 0; j < a.length; j++) {
- expect(i == j, a[i] == a[j]);
- }
- }
- });
-
- test('runtimeType', () {
- var nodes1 = makeNodeList();
- var nodes2 = makeNodeList();
- var type1 = nodes1.runtimeType;
- var type2 = nodes2.runtimeType;
- expect(type1 == type2, true);
- String name = '$type1';
- if (name.length > 3) {
- expect(name.contains('NodeList') || name.contains('HtmlCollection'),
- true);
- }
- });
-
- test('first', () {
- var nodes = makeNodeList();
- expect(nodes.first, isBRElement);
- });
-
- test('last', () {
- var nodes = makeNodeList();
- expect(nodes.last, isBRElement);
- });
-
- test('where', () {
- var filtered = makeNodeList().where((n) => n is BRElement).toList();
- expect(filtered.length, 3);
- expect(filtered[0], isBRElement);
- expect(filtered, isNodeList);
- });
-
- test('sublist', () {
- var range = makeNodeList().sublist(1, 3);
- expect(range.length, 2);
- expect(range[0], isBRElement);
- expect(range[1], isBRElement);
- });
-
- });
-
group('iterating', () {
test('NodeIterator', () {
var root = makeNodeWithChildren();
« no previous file with comments | « tests/html/element_test.dart ('k') | tools/dom/dom.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698