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

Unified Diff: tests/html/node_test.dart

Issue 15039023: Revert "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 acab82a20bbc4c9cb01574efa0b13b273b004947..083478f87b04c33a9a9ab0c38956dec148f90093 100644
--- a/tests/html/node_test.dart
+++ b/tests/html/node_test.dart
@@ -335,81 +335,28 @@ 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.
-
+ group('_NodeList', () {
List<Node> makeNodeList() =>
- (new Element.html("<div>Foo<br/><!--baz--><br/><br/></div>"))
- .$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.contains('NodeList'), true);
- }
- });
+ makeNodeWithChildren().nodes.where((_) => true).toList();
test('first', () {
var nodes = makeNodeList();
- expect(nodes.first, isBRElement);
- });
-
- test('last', () {
- var nodes = makeNodeList();
- expect(nodes.last, isBRElement);
+ expect(nodes.first, isText);
});
test('where', () {
var filtered = makeNodeList().where((n) => n is BRElement).toList();
- expect(filtered.length, 3);
+ expect(filtered.length, 1);
expect(filtered[0], isBRElement);
expect(filtered, isNodeList);
});
test('sublist', () {
var range = makeNodeList().sublist(1, 3);
- expect(range.length, 2);
+ expect(range, isNodeList);
expect(range[0], isBRElement);
- expect(range[1], isBRElement);
+ expect(range[1], isComment);
});
-
});
group('iterating', () {
« 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