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

Unified Diff: tests/html/queryall_test.dart

Issue 11275054: Modified unittest to use new argument syntax. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
Index: tests/html/queryall_test.dart
===================================================================
--- tests/html/queryall_test.dart (revision 14156)
+++ tests/html/queryall_test.dart (working copy)
@@ -10,6 +10,11 @@
main() {
useHtmlConfiguration();
+ var isElement = predicate((x) => x is Element, 'is an Element');
+ var isCanvasElement =
+ predicate((x) => x is CanvasElement, 'is a CanvasElement');
+ var isDivElement = predicate((x) => x is DivElement, 'is a isDivElement');
+
var div = new DivElement();
div.id = 'test';
document.body.nodes.add(div);
@@ -26,7 +31,7 @@
test('queryAll', () {
List<Node> all = queryAll('*');
for (var e in all) {
- expect(e is Element, isTrue);
+ expect(e, isElement);
}
});
@@ -42,7 +47,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 +71,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', () {

Powered by Google App Engine
This is Rietveld 408576698