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

Unified Diff: pkg/dev_compiler/test/codegen/lib/html/documentfragment_test.dart

Issue 2413073002: Start cleaning up the HTML tests. (Closed)
Patch Set: Unfork expect.dart. 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 side-by-side diff with in-line comments
Download patch
Index: pkg/dev_compiler/test/codegen/lib/html/documentfragment_test.dart
diff --git a/pkg/dev_compiler/test/codegen/lib/html/documentfragment_test.dart b/pkg/dev_compiler/test/codegen/lib/html/documentfragment_test.dart
index b09c04d6f08ef53432631096bc1d55416188dd63..804cd9bd800ee1d6ff7ff6aab47f819b182136af 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/documentfragment_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/documentfragment_test.dart
@@ -2,15 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library DocumentFragmentTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
-import 'util.dart';
import 'dart:html';
-main() {
- useHtmlConfiguration();
+import 'package:minitest/minitest.dart';
+import 'util.dart';
+
+main() {
var isAnchorElement =
predicate((x) => x is AnchorElement, 'is an AnchorElement');
@@ -42,7 +40,7 @@ main() {
expect(style.cssText, equals(''));
expect(style.getPropertyPriority('color'), equals(''));
expect(style.item(0), equals(''));
- expect(style.length, isZero);
+ expect(style.length, equals(0));
// TODO(jacobr): these checks throw UnimplementedErrors in dartium.
// expect(style.parentRule, isNull);
// expect(style.getPropertyCssValue('color'), isNull);
@@ -81,8 +79,8 @@ main() {
});
group('children', () {
- var fragment;
- var children;
+ DocumentFragment fragment;
+ List<Element> children;
init() {
fragment = new DocumentFragment();
@@ -102,36 +100,36 @@ main() {
test('filters out non-element nodes', () {
init();
expect(_nodeStrings(fragment.nodes),
- orderedEquals(["1", "A", "B", "2", "I", "3", "U"]));
+ equals(["1", "A", "B", "2", "I", "3", "U"]));
expect(_nodeStrings(children),
- orderedEquals(["A", "B", "I", "U"]));
+ equals(["A", "B", "I", "U"]));
});
test('only indexes children, not other nodes', () {
init();
children[1] = new Element.tag("BR");
expect(_nodeStrings(fragment.nodes),
- orderedEquals(["1", "A", "BR", "2", "I", "3", "U"]));
+ equals(["1", "A", "BR", "2", "I", "3", "U"]));
expect(_nodeStrings(children),
- orderedEquals(["A", "BR", "I", "U"]));
+ equals(["A", "BR", "I", "U"]));
});
test('adds to both children and nodes', () {
init();
children.add(new Element.tag("UL"));
expect(_nodeStrings(fragment.nodes),
- orderedEquals(["1", "A", "B", "2", "I", "3", "U", "UL"]));
+ equals(["1", "A", "B", "2", "I", "3", "U", "UL"]));
expect(_nodeStrings(children),
- orderedEquals(["A", "B", "I", "U", "UL"]));
+ equals(["A", "B", "I", "U", "UL"]));
});
test('removes only children, from both children and nodes', () {
init();
expect(children.removeLast().tagName, equals('U'));
expect(_nodeStrings(fragment.nodes),
- orderedEquals(["1", "A", "B", "2", "I", "3"]));
+ equals(["1", "A", "B", "2", "I", "3"]));
expect(_nodeStrings(children),
- orderedEquals(["A", "B", "I"]));
+ equals(["A", "B", "I"]));
expect(children.removeLast().tagName, "I");
expect(_nodeStrings(fragment.nodes),

Powered by Google App Engine
This is Rietveld 408576698