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

Unified Diff: tests/html/node_test.dart

Issue 14619026: dart2js native mixin application should extend 'Interface', not 'Object' (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/web_sql/dart2js/web_sql_dart2js.dart ('k') | tools/dom/scripts/systemhtml.py » ('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 c8a009cdc3a535be01311d3d97aa03830ca7ba99..a32af53833aa779552a6623424fc57b34b801897 100644
--- a/tests/html/node_test.dart
+++ b/tests/html/node_test.dart
@@ -324,6 +324,51 @@ main() {
});
});
+ group('NodeList', () {
blois 2013/05/10 00:34:30 Why not put it in group('_NodeList')? Names are t
sra1 2013/05/10 22:13:26 Done.
+ // Tests for methods on the DOM class 'NodeList' that get their
+ // implementation from 'Object' and/or 'Interceptor'. Some of these tests
+ // simply check that a method can be called.
+ List<Node> makeNodeList() =>
+ makeNodeWithChildren().$dom_getElementsByTagName('br');
+
+ test('trueNodeList', () {
+ var nodes = makeNodeList();
+ expect(nodes is NodeList, 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, 'NodeList');
+ }
+ });
+ });
+
group('_NodeList', () {
List<Node> makeNodeList() =>
makeNodeWithChildren().nodes.where((_) => true).toList();
« no previous file with comments | « sdk/lib/web_sql/dart2js/web_sql_dart2js.dart ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698