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:expect/minitest.dart'; | 7 import 'package:expect/minitest.dart'; |
8 | 8 |
9 import 'util.dart'; | 9 import 'util.dart'; |
10 | 10 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 test('getting innerHtml works', () { | 166 test('getting innerHtml works', () { |
167 var fragment = new DocumentFragment(); | 167 var fragment = new DocumentFragment(); |
168 fragment.nodes.addAll([new Text("foo"), new Element.html("<A>bar</A>")]); | 168 fragment.nodes.addAll([new Text("foo"), new Element.html("<A>bar</A>")]); |
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<Element>(".foo *")), |
| 177 equals(["A", "B"])); |
177 }); | 178 }); |
178 } | 179 } |
OLD | NEW |