| Index: tests/html/documentfragment_test.dart
|
| diff --git a/tests/html/documentfragment_test.dart b/tests/html/documentfragment_test.dart
|
| index b09c04d6f08ef53432631096bc1d55416188dd63..f2c42a6b13d35c35a4fe48596d906b45a0d058be 100644
|
| --- a/tests/html/documentfragment_test.dart
|
| +++ b/tests/html/documentfragment_test.dart
|
| @@ -3,6 +3,7 @@
|
| // 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';
|
| @@ -25,7 +26,9 @@ main() {
|
| }
|
| }
|
| return out;
|
| - };
|
| + }
|
| +
|
| + ;
|
|
|
| assertConstError(void fn()) {
|
| try {
|
| @@ -36,7 +39,9 @@ main() {
|
| }
|
| }
|
| expect(true, isFalse, reason: 'Expected immutability error');
|
| - };
|
| + }
|
| +
|
| + ;
|
|
|
| void expectEmptyStyleDeclaration(CssStyleDeclaration style) {
|
| expect(style.cssText, equals(''));
|
| @@ -87,11 +92,18 @@ main() {
|
| init() {
|
| fragment = new DocumentFragment();
|
| children = fragment.children;
|
| - fragment.nodes.addAll(
|
| - [new Text("1"), new Element.tag("A"), new Element.tag("B"),
|
| - new Text("2"), new Element.tag("I"), new Text("3"),
|
| - new Element.tag("U")]);
|
| - };
|
| + fragment.nodes.addAll([
|
| + new Text("1"),
|
| + new Element.tag("A"),
|
| + new Element.tag("B"),
|
| + new Text("2"),
|
| + new Element.tag("I"),
|
| + new Text("3"),
|
| + new Element.tag("U")
|
| + ]);
|
| + }
|
| +
|
| + ;
|
|
|
| test('is initially empty', () {
|
| children = new DocumentFragment().children;
|
| @@ -103,8 +115,7 @@ main() {
|
| init();
|
| expect(_nodeStrings(fragment.nodes),
|
| orderedEquals(["1", "A", "B", "2", "I", "3", "U"]));
|
| - expect(_nodeStrings(children),
|
| - orderedEquals(["A", "B", "I", "U"]));
|
| + expect(_nodeStrings(children), orderedEquals(["A", "B", "I", "U"]));
|
| });
|
|
|
| test('only indexes children, not other nodes', () {
|
| @@ -112,8 +123,7 @@ main() {
|
| children[1] = new Element.tag("BR");
|
| expect(_nodeStrings(fragment.nodes),
|
| orderedEquals(["1", "A", "BR", "2", "I", "3", "U"]));
|
| - expect(_nodeStrings(children),
|
| - orderedEquals(["A", "BR", "I", "U"]));
|
| + expect(_nodeStrings(children), orderedEquals(["A", "BR", "I", "U"]));
|
| });
|
|
|
| test('adds to both children and nodes', () {
|
| @@ -121,8 +131,7 @@ main() {
|
| children.add(new Element.tag("UL"));
|
| expect(_nodeStrings(fragment.nodes),
|
| orderedEquals(["1", "A", "B", "2", "I", "3", "U", "UL"]));
|
| - expect(_nodeStrings(children),
|
| - orderedEquals(["A", "B", "I", "U", "UL"]));
|
| + expect(_nodeStrings(children), orderedEquals(["A", "B", "I", "U", "UL"]));
|
| });
|
|
|
| test('removes only children, from both children and nodes', () {
|
| @@ -130,12 +139,10 @@ main() {
|
| expect(children.removeLast().tagName, equals('U'));
|
| expect(_nodeStrings(fragment.nodes),
|
| orderedEquals(["1", "A", "B", "2", "I", "3"]));
|
| - expect(_nodeStrings(children),
|
| - orderedEquals(["A", "B", "I"]));
|
| + expect(_nodeStrings(children), orderedEquals(["A", "B", "I"]));
|
|
|
| expect(children.removeLast().tagName, "I");
|
| - expect(_nodeStrings(fragment.nodes),
|
| - equals(["1", "A", "B", "2", "3"]));
|
| + expect(_nodeStrings(fragment.nodes), equals(["1", "A", "B", "2", "3"]));
|
| expect(_nodeStrings(children), equals(["A", "B"]));
|
| });
|
|
|
| @@ -173,7 +180,7 @@ main() {
|
|
|
| test('query searches the fragment', () {
|
| var fragment = new DocumentFragment.html(
|
| - "<div class='foo'><a>foo</a><b>bar</b></div>");
|
| + "<div class='foo'><a>foo</a><b>bar</b></div>");
|
| expect(fragment.query(".foo a").tagName, "A");
|
| expect(_nodeStrings(fragment.queryAll(".foo *")), equals(["A", "B"]));
|
| });
|
|
|