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

Unified Diff: tests/html/htmlelement_test.dart

Issue 26917002: Convert keys in dataSet to camelCase instead of dasherized. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/src/AttributeMap.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {}
+}
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/src/AttributeMap.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698