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

Unified Diff: tests/html/selectelement_test.dart

Issue 11031076: Fixes to get SelectElement working properly on IE. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | « lib/html/templates/html/dart2js/impl_SelectElement.darttemplate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/selectelement_test.dart
diff --git a/tests/html/selectelement_test.dart b/tests/html/selectelement_test.dart
index 4f375510a09fa6af35c5446a84e415fada2b36dd..2a766c374ba84432ab3cb8ac0b1001266f2a2075 100644
--- a/tests/html/selectelement_test.dart
+++ b/tests/html/selectelement_test.dart
@@ -12,15 +12,18 @@ main() {
test('selectedOptions', () {
var element = new SelectElement();
+ element.multiple = false;
var options = [
new OptionElement(),
+ new DivElement(),
new OptionElement('data', 'two', false, true),
+ new DivElement(),
new OptionElement('data', 'two', false, true),
new OptionElement(),
];
element.elements.addAll(options);
expect(element.selectedOptions.length, 1);
- expect(element.selectedOptions[0] == options[2]);
+ expect(element.selectedOptions[0] == options[4]);
});
test('multiple selectedOptions', () {
@@ -28,13 +31,28 @@ main() {
element.multiple = true;
var options = [
new OptionElement(),
+ new DivElement(),
new OptionElement('data', 'two', false, true),
+ new DivElement(),
new OptionElement('data', 'two', false, true),
new OptionElement(),
];
element.elements.addAll(options);
expect(element.selectedOptions.length, 2);
- expect(element.selectedOptions[0] == options[1]);
- expect(element.selectedOptions[1] == options[2]);
+ expect(element.selectedOptions[0] == options[2]);
+ expect(element.selectedOptions[1] == options[4]);
+ });
+
+ test('options', () {
+ var element = new SelectElement();
+ var options = [
+ new OptionElement(),
+ new OptionElement('data', 'two', false, true),
+ new OptionElement('data', 'two', false, true),
+ new OptionElement(),
+ ];
+ element.elements.addAll(options);
+ // Use last to make sure that the list was correctly wrapped.
+ expect(element.options.last(), options[3]);
});
}
« no previous file with comments | « lib/html/templates/html/dart2js/impl_SelectElement.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698