Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: pkg/mdv/test/custom_element_bindings_test.dart

Issue 16374007: First rev of Safe DOM (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/mdv/test/template_element_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/mdv/test/template_element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698