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

Unified Diff: tests/html/element_classes_test.dart

Issue 18583004: Added boolean to toggle. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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/html_common/css_class_set.dart ('k') | tools/dom/src/CssClassSet.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/element_classes_test.dart
diff --git a/tests/html/element_classes_test.dart b/tests/html/element_classes_test.dart
index 3c628b919852a962f980c09b6aed5e5246626f45..f4ed7a4e6189ca4ac5a09747e9cb1c74ba1cfce3 100644
--- a/tests/html/element_classes_test.dart
+++ b/tests/html/element_classes_test.dart
@@ -131,6 +131,15 @@ main() {
expect(classes, orderedEquals(['foo', 'baz']));
classes.toggle('qux');
expect(classes, orderedEquals(['foo', 'baz', 'qux']));
+
+ classes.toggle('qux', true);
+ expect(classes, orderedEquals(['foo', 'baz', 'qux']));
+ classes.toggle('qux', false);
+ expect(classes, orderedEquals(['foo', 'baz']));
+ classes.toggle('qux', false);
+ expect(classes, orderedEquals(['foo', 'baz']));
+ classes.toggle('qux', true);
+ expect(classes, orderedEquals(['foo', 'baz', 'qux']));
});
test('addAll', () {
@@ -151,6 +160,10 @@ main() {
expect(classes, orderedEquals(['baz']));
classes.toggleAll(['qux', 'quux']);
expect(classes, orderedEquals(['baz', 'qux', 'quux']));
+ classes.toggleAll(['bar', 'foo'], true);
+ expect(classes, orderedEquals(['baz', 'qux', 'quux', 'bar', 'foo']));
+ classes.toggleAll(['baz', 'quux'], false);
+ expect(classes, orderedEquals(['qux','bar', 'foo']));
});
test('containsAll', () {
« no previous file with comments | « sdk/lib/html/html_common/css_class_set.dart ('k') | tools/dom/src/CssClassSet.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698