OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library custom_element_bindings_test; | 5 library custom_element_bindings_test; |
6 | 6 |
7 import 'dart:html'; | 7 import 'dart:html'; |
8 import 'package:mdv/mdv.dart' as mdv; | 8 import 'package:mdv/mdv.dart' as mdv; |
9 import 'package:unittest/html_config.dart'; | 9 import 'package:unittest/html_config.dart'; |
10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
(...skipping 14 matching lines...) Expand all Loading... |
25 document.body.append(testDiv = new DivElement()); | 25 document.body.append(testDiv = new DivElement()); |
26 }); | 26 }); |
27 | 27 |
28 tearDown(() { | 28 tearDown(() { |
29 testDiv.remove(); | 29 testDiv.remove(); |
30 testDiv = null; | 30 testDiv = null; |
31 }); | 31 }); |
32 | 32 |
33 createTestHtml(s) { | 33 createTestHtml(s) { |
34 var div = new DivElement(); | 34 var div = new DivElement(); |
35 div.innerHtml = s; | 35 div.setInnerHtml(s, treeSanitizer: new NullTreeSanitizer()); |
36 testDiv.append(div); | 36 testDiv.append(div); |
37 | 37 |
38 for (var node in div.queryAll('*')) { | 38 for (var node in div.queryAll('*')) { |
39 if (node.isTemplate) TemplateElement.decorate(node); | 39 if (node.isTemplate) TemplateElement.decorate(node); |
40 } | 40 } |
41 | 41 |
42 return div; | 42 return div; |
43 } | 43 } |
44 | 44 |
45 | 45 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 } | 266 } |
267 | 267 |
268 void clear() => _map.clear(); | 268 void clear() => _map.clear(); |
269 void forEach(void f(K key, V value)) => _map.forEach(f); | 269 void forEach(void f(K key, V value)) => _map.forEach(f); |
270 Iterable<K> get keys => _map.keys; | 270 Iterable<K> get keys => _map.keys; |
271 Iterable<V> get values => _map.values; | 271 Iterable<V> get values => _map.values; |
272 int get length => _map.length; | 272 int get length => _map.length; |
273 bool get isEmpty => _map.isEmpty; | 273 bool get isEmpty => _map.isEmpty; |
274 bool get isNotEmpty => _map.isNotEmpty; | 274 bool get isNotEmpty => _map.isNotEmpty; |
275 } | 275 } |
| 276 |
| 277 /** |
| 278 * Sanitizer which does nothing. |
| 279 */ |
| 280 class NullTreeSanitizer implements NodeTreeSanitizer { |
| 281 void sanitizeTree(Node node) {} |
| 282 } |
OLD | NEW |