OLD | NEW |
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 testDocumentFragment() { | 5 testDocumentFragment() { |
6 Collection<String> _nodeStrings(Collection<Node> input) { | 6 Collection<String> _nodeStrings(Collection<Node> input) { |
7 var out = new List<String>(); | 7 var out = new List<String>(); |
8 for (Node n in input) { | 8 for (Node n in input) { |
9 if (n is Element) { | 9 if (n is Element) { |
10 Element e = n; | 10 Element e = n; |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 // // assertConstError(() => fragment.classes.add('foo')); | 338 // // assertConstError(() => fragment.classes.add('foo')); |
339 // }); | 339 // }); |
340 | 340 |
341 test('query searches the fragment', () { | 341 test('query searches the fragment', () { |
342 var fragment = new DocumentFragment.html( | 342 var fragment = new DocumentFragment.html( |
343 "<div class='foo'><a>foo</a><b>bar</b></div>"); | 343 "<div class='foo'><a>foo</a><b>bar</b></div>"); |
344 Expect.equals("A", fragment.query(".foo a").tagName); | 344 Expect.equals("A", fragment.query(".foo a").tagName); |
345 Expect.listEquals(["A", "B"], _nodeStrings(fragment.queryAll(".foo *"))); | 345 Expect.listEquals(["A", "B"], _nodeStrings(fragment.queryAll(".foo *"))); |
346 }); | 346 }); |
347 } | 347 } |
OLD | NEW |