]> source.dussan.org Git - vaadin-framework.git/commitdiff
[merge from 6.7] Test case for #8781
authorAutomerge <automerge@vaadin.com>
Wed, 9 May 2012 17:06:15 +0000 (17:06 +0000)
committerAutomerge <automerge@vaadin.com>
Wed, 9 May 2012 17:06:15 +0000 (17:06 +0000)
svn changeset:23699/svn branch:6.8

WebContent/statictestfiles/dummy.zip [new file with mode: 0644]
tests/testbench/com/vaadin/tests/components/window/DownloadAndUpdate.java [new file with mode: 0644]

diff --git a/WebContent/statictestfiles/dummy.zip b/WebContent/statictestfiles/dummy.zip
new file mode 100644 (file)
index 0000000..e6e3428
Binary files /dev/null and b/WebContent/statictestfiles/dummy.zip differ
diff --git a/tests/testbench/com/vaadin/tests/components/window/DownloadAndUpdate.java b/tests/testbench/com/vaadin/tests/components/window/DownloadAndUpdate.java
new file mode 100644 (file)
index 0000000..ca9c315
--- /dev/null
@@ -0,0 +1,45 @@
+package com.vaadin.tests.components.window;
+
+import com.vaadin.terminal.ExternalResource;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Table;
+
+public class DownloadAndUpdate extends TestBase {
+
+    @Override
+    protected void setup() {
+        addComponent(new Button("Download and update",
+                new Button.ClickListener() {
+                    public void buttonClick(ClickEvent 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);
+    }
+
+}