Index: tests/html/queryall_test.dart |
=================================================================== |
--- tests/html/queryall_test.dart (revision 14114) |
+++ tests/html/queryall_test.dart (working copy) |
@@ -10,6 +10,10 @@ |
main() { |
useHtmlConfiguration(); |
+ var isElement = new isInstanceOf<Element>('Element'); |
+ var isCanvasElement = new isInstanceOf<CanvasElement>('CanvasElement'); |
+ var isDivElement = new isInstanceOf<DivElement>('DivElement'); |
+ |
var div = new DivElement(); |
div.id = 'test'; |
document.body.nodes.add(div); |
@@ -26,7 +30,7 @@ |
test('queryAll', () { |
List<Node> all = queryAll('*'); |
for (var e in all) { |
- expect(e is Element, isTrue); |
+ expect(e, isElement); |
} |
}); |
@@ -42,7 +46,7 @@ |
test('queryAll-canvas', () { |
List<CanvasElement> all = queryAll('canvas'); |
for (var e in all) { |
- expect(e is CanvasElement, isTrue); |
+ expect(e, isCanvasElement); |
} |
expect(all.length, equals(2)); |
}); |
@@ -66,11 +70,11 @@ |
test('node.queryAll', () { |
List<Element> list = div.queryAll('*'); |
expect(list.length, equals(5)); |
- expect(list[0] is DivElement, isTrue); |
- expect(list[1] is CanvasElement, isTrue); |
- expect(list[2] is DivElement, isTrue); |
- expect(list[3] is DivElement, isTrue); |
- expect(list[4] is CanvasElement, isTrue); |
+ expect(list[0], isDivElement); |
+ expect(list[1], isCanvasElement); |
+ expect(list[2], isDivElement); |
+ expect(list[3], isDivElement); |
+ expect(list[4], isCanvasElement); |
}); |
test('immutable', () { |