--- /dev/null
+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