]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test class for #4014
authorHenri Sara <henri.sara@itmill.com>
Thu, 28 Jan 2010 12:33:49 +0000 (12:33 +0000)
committerHenri Sara <henri.sara@itmill.com>
Thu, 28 Jan 2010 12:33:49 +0000 (12:33 +0000)
svn changeset:11041/svn branch:6.2

tests/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorInvisible.java [new file with mode: 0644]

diff --git a/tests/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorInvisible.java b/tests/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorInvisible.java
new file mode 100644 (file)
index 0000000..026465a
--- /dev/null
@@ -0,0 +1,52 @@
+package com.vaadin.tests.components.progressindicator;\r
+\r
+import com.vaadin.tests.components.TestBase;\r
+import com.vaadin.ui.Button;\r
+import com.vaadin.ui.ProgressIndicator;\r
+import com.vaadin.ui.VerticalLayout;\r
+import com.vaadin.ui.Button.ClickEvent;\r
+\r
+public class ProgressIndicatorInvisible extends TestBase {\r
+\r
+    @Override\r
+    protected void setup() {\r
+        final VerticalLayout lo = new VerticalLayout();\r
+\r
+        addComponent(lo);\r
+\r
+        final ProgressIndicator pi = new ProgressIndicator();\r
+        pi.setPollingInterval(400);\r
+        lo.addComponent(pi);\r
+\r
+        final Button b = new Button("Hide container of progress indicator");\r
+        addComponent(b);\r
+\r
+        b.addListener(new Button.ClickListener() {\r
+            public void buttonClick(ClickEvent event) {\r
+                // If we skip hiding the layout, hiding the ProgressIndicator\r
+                // will stop the polling\r
+                lo.setVisible(!lo.isVisible());\r
+                // Not even this works\r
+                pi.setVisible(!lo.isVisible());\r
+                if (!lo.isVisible()) {\r
+                    b.setCaption("Still polling");\r
+                } else {\r
+                    b.setCaption("Hide container of progress indicator");\r
+                }\r
+\r
+            }\r
+\r
+        });\r
+    }\r
+\r
+    @Override\r
+    protected String getDescription() {\r
+        return "Progress indicator does not stop polling when its parent layout is made invisible";\r
+    }\r
+\r
+    @Override\r
+    protected Integer getTicketNumber() {\r
+        return 4014;\r
+    }\r
+\r
+}\r