Chromium Code Reviews| Index: tests/html/htmlelement_test.dart |
| diff --git a/tests/html/htmlelement_test.dart b/tests/html/htmlelement_test.dart |
| index df2704dfb53fc468ac685bedc0b610fb6d8bb45d..764f5f176d1d2e4b568e3e17c5ab8b04cb4998a9 100644 |
| --- a/tests/html/htmlelement_test.dart |
| +++ b/tests/html/htmlelement_test.dart |
| @@ -87,5 +87,24 @@ main() { |
| div.dataset.clear(); |
| expect(div.dataset.length, 0); |
| expect(div.dataset.isEmpty, isTrue); |
| + |
| + Element otherDiv = new Element.html( |
| + '<div id="dataDiv" data-my-message="Hello World"></div>', |
| + treeSanitizer: new UnhelpfulSanitizer()); |
| + expect(otherDiv.dataset.containsKey('myMessage'), isTrue); |
| + |
| + Element anotherDiv = new Element.html( |
| + '<div id="dataDiv" data-eggs="bacon"></div>', |
| + treeSanitizer: new UnhelpfulSanitizer()); |
| + expect(anotherDiv.dataset.containsKey('eggs'), isTrue); |
| }); |
| } |
| + |
| +/** |
| + * A sanitizer that doesn't actually do anything! Allows us to add custom |
| + * attributes (and anything else). |
| + */ |
| +class UnhelpfulSanitizer implements NodeTreeSanitizer { |
|
blois
2013/10/10 21:13:39
import utils.dart and use NullTreeSanitizer from t
|
| + UnhelpfulSanitizer(); |
| + void sanitizeTree(Node node) {} |
| +} |