aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/components/window/SubWindowPositionUpdate.java
blob: 9383dba80f7a57c919692a37001db0241b3bd0d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.vaadin.tests.components.window;

import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.ProgressIndicator;
import com.vaadin.ui.Window;

public class SubWindowPositionUpdate extends TestBase {

    static int delay = 400;

    @Override
    protected void setup() {
        Window subWindow = new Window("Draggable sub window") {
            @Override
            public void setPositionX(int positionX) {
                try {
                    Thread.sleep(delay);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                super.setPositionX(positionX);
            }
        };
        getMainWindow().addWindow(subWindow);
        ProgressIndicator pi = new ProgressIndicator();
        pi.setIndeterminate(true);
        pi.setPollingInterval(delay);
        addComponent(pi);
    }

    @Override
    protected String getDescription() {
        return "The window position should not jump inconsistently while "
                + "dragging, even though external UIDL updates are sent and "
                + "received by the progress indicator. A small delay is used "
                + "on the server side to surface the issue (" + delay + "ms).";
    }

    @Override
    protected Integer getTicketNumber() {
        return 4427;
    }

}