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

Unified Diff: tests/html/selectelement_test.dart

Issue 16409002: Fixing SelectElement.options, adding support for optgroup. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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
Index: tests/html/selectelement_test.dart
diff --git a/tests/html/selectelement_test.dart b/tests/html/selectelement_test.dart
index 300e29ec6180e1b5b5a79ee3e166730c8e05b1ab..8b7d76b1e9fe4842b1c84414a50a65b99f6708de 100644
--- a/tests/html/selectelement_test.dart
+++ b/tests/html/selectelement_test.dart
@@ -55,4 +55,21 @@ main() {
// Use last to make sure that the list was correctly wrapped.
expect(element.options.last, equals(options[3]));
});
+
+ test('optgroup', () {
+ var element = new SelectElement();
+ element.innerHtml =
+ '<option>1</option>'
+ '<optgroup>'
+ '<option>2</option>'
+ '</optgroup>';
+
+ expect(element.options.length, 2);
+ element.selectedIndex = 1;
+
+ var optGroup = element.children[1];
+ expect(optGroup is OptGroupElement, isTrue);
+ expect(optGroup.children.single.selected, isTrue);
+ expect(element.selectedOptions, optGroup.children);
+ });
}
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/templates/html/impl/impl_HTMLSelectElement.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698