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 import 'dart:html'; | 5 import 'dart:html'; |
6 | 6 |
7 import 'package:minitest/minitest.dart'; | 7 import 'package:expect/minitest.dart'; |
8 | 8 |
9 import 'util.dart'; | 9 import 'util.dart'; |
10 | 10 |
11 main() { | 11 main() { |
12 var isAnchorElement = | 12 var isAnchorElement = |
13 predicate((x) => x is AnchorElement, 'is an AnchorElement'); | 13 predicate((x) => x is AnchorElement, 'is an AnchorElement'); |
14 | 14 |
15 List<String> _nodeStrings(Iterable<Node> input) { | 15 List<String> _nodeStrings(Iterable<Node> input) { |
16 var out = new List<String>(); | 16 var out = new List<String>(); |
17 for (Node n in input) { | 17 for (Node n in input) { |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 expect(fragment.innerHtml, "foo<a>bar</a>"); | 169 expect(fragment.innerHtml, "foo<a>bar</a>"); |
170 }); | 170 }); |
171 | 171 |
172 test('query searches the fragment', () { | 172 test('query searches the fragment', () { |
173 var fragment = new DocumentFragment.html( | 173 var fragment = new DocumentFragment.html( |
174 "<div class='foo'><a>foo</a><b>bar</b></div>"); | 174 "<div class='foo'><a>foo</a><b>bar</b></div>"); |
175 expect(fragment.query(".foo a").tagName, "A"); | 175 expect(fragment.query(".foo a").tagName, "A"); |
176 expect(_nodeStrings(fragment.queryAll(".foo *")), equals(["A", "B"])); | 176 expect(_nodeStrings(fragment.queryAll(".foo *")), equals(["A", "B"])); |
177 }); | 177 }); |
178 } | 178 } |
OLD | NEW |