]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test case for #8321
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>
Wed, 1 Feb 2012 12:54:37 +0000 (12:54 +0000)
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>
Wed, 1 Feb 2012 12:54:37 +0000 (12:54 +0000)
svn changeset:22849/svn branch:6.7

tests/testbench/com/vaadin/tests/components/select/FocusListenerBreaksDropdownMenu.java [new file with mode: 0644]

diff --git a/tests/testbench/com/vaadin/tests/components/select/FocusListenerBreaksDropdownMenu.java b/tests/testbench/com/vaadin/tests/components/select/FocusListenerBreaksDropdownMenu.java
new file mode 100644 (file)
index 0000000..dd2a8bb
--- /dev/null
@@ -0,0 +1,37 @@
+package com.vaadin.tests.components.select;
+
+import com.vaadin.event.FieldEvents;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.ComboBox;
+
+public class FocusListenerBreaksDropdownMenu extends TestBase {
+
+    @Override
+    protected void setup() {
+        final ComboBox comboBox = new ComboBox();
+        for (int i = 0; i < 5; ++i) {
+            comboBox.addItem("Item " + i);
+        }
+
+        comboBox.addListener(new FieldEvents.FocusListener() {
+            public void focus(FieldEvents.FocusEvent event) {
+                comboBox.addItem();
+            }
+        });
+
+        comboBox.setImmediate(true);
+        addComponent(comboBox);
+    }
+
+    @Override
+    protected String getDescription() {
+        return "Clicking the dropdown arrow on a not-already-focused ComboBox "
+                + "breaks the dropdown list if a FocusListener adds or removes items";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return 8321;
+    }
+
+}