aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com/vaadin/tests/components/window/DownloadAndUpdate.java
blob: 107e30904d81377d1b7dbc34025a30d2e658e58d (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
package com.vaadin.tests.components.window;

import com.vaadin.server.ExternalResource;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.v7.ui.Table;

public class DownloadAndUpdate extends TestBase {

    @Override
    protected void setup() {
        addComponent(new Button("Download and update",
                event -> downloadAndUpdate()));
    }

    protected void downloadAndUpdate() {
        getMainWindow().open(
                new ExternalResource("/statictestfiles/dummy.zip", "_new"));

        // Any component sending an UIDL request when rendered will likely do
        Table table = new Table();
        table.addContainerProperty("A", String.class, "");
        for (int i = 0; i < 100; i++) {
            table.addItem(new Object[] { Integer.toString(i) },
                    Integer.valueOf(i));
        }
        addComponent(table);
    }

    @Override
    protected String getDescription() {
        return "There should be no problems downloading a file from the same request that triggers another request, even in webkit browsers.";
    }

    @Override
    protected Integer getTicketNumber() {
        return Integer.valueOf(8781);
    }

}