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

Side by Side Diff: pkg/dev_compiler/test/codegen/lib/html/node_test.dart

Issue 2419863002: Remove uses of unittest in the HTML tests where possible. (Closed)
Patch Set: Remove TODO. Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library NodeTest;
6 import 'package:unittest/unittest.dart';
7 import 'package:unittest/html_individual_config.dart';
8 import 'dart:html'; 5 import 'dart:html';
9 import 'dart:svg' as svg; 6 import 'dart:svg' as svg;
10 7
8 import 'package:expect/minitest.dart';
9
11 Node makeNode() => new Element.tag('div'); 10 Node makeNode() => new Element.tag('div');
12 Node makeNodeWithChildren() => 11 Element makeNodeWithChildren() =>
13 new Element.html("<div>Foo<br/><!--baz--></div>"); 12 new Element.html("<div>Foo<br/><!--baz--></div>");
14 13
15 void testUnsupported(String name, void f()) { 14 void testUnsupported(String name, void f()) {
16 test(name, () { 15 test(name, () {
17 expect(f, throwsUnsupportedError); 16 expect(f, throwsUnsupportedError);
18 }); 17 });
19 } 18 }
20 19
21 main() { 20 main() {
22 useHtmlIndividualConfiguration();
23
24 var isText = predicate((x) => x is Text, 'is a Text'); 21 var isText = predicate((x) => x is Text, 'is a Text');
25 var isComment = predicate((x) => x is Comment, 'is a Comment'); 22 var isComment = predicate((x) => x is Comment, 'is a Comment');
26 var isBRElement = predicate((x) => x is BRElement, 'is a BRElement'); 23 var isBRElement = predicate((x) => x is BRElement, 'is a BRElement');
27 var isHRElement = predicate((x) => x is HRElement, 'is a HRElement'); 24 var isHRElement = predicate((x) => x is HRElement, 'is a HRElement');
28 var isNodeList = predicate((x) => x is List<Node>, 'is a List<Node>'); 25 var isNodeList = predicate((x) => x is List<Node>, 'is a List<Node>');
29 var isImageElement = 26 var isImageElement =
30 predicate((x) => x is ImageElement, 'is an ImageElement'); 27 predicate((x) => x is ImageElement, 'is an ImageElement');
31 var isInputElement = 28 var isInputElement =
32 predicate((x) => x is InputElement, 'is an InputElement'); 29 predicate((x) => x is InputElement, 'is an InputElement');
33 30
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 }); 348 });
352 349
353 test('TreeWalker', () { 350 test('TreeWalker', () {
354 var root = makeNodeWithChildren(); 351 var root = makeNodeWithChildren();
355 var treeWalker = new TreeWalker(root, NodeFilter.SHOW_COMMENT); 352 var treeWalker = new TreeWalker(root, NodeFilter.SHOW_COMMENT);
356 expect(treeWalker.nextNode(), isComment); 353 expect(treeWalker.nextNode(), isComment);
357 expect(treeWalker.nextNode(), isNull); 354 expect(treeWalker.nextNode(), isNull);
358 }); 355 });
359 }); 356 });
360 } 357 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698