summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java')
-rw-r--r--uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java
new file mode 100644
index 0000000000..3013659ed7
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java
@@ -0,0 +1,45 @@
+package com.vaadin.tests.application;
+
+import com.vaadin.Application;
+import com.vaadin.UIRequiresMoreInformationException;
+import com.vaadin.server.AbstractUIProvider;
+import com.vaadin.server.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestApplication;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI;
+
+public class RefreshStatePreserve extends AbstractTestApplication {
+ public static class RefreshStateUI extends UI {
+ @Override
+ public void init(WrappedRequest request) {
+ getContent().addComponent(
+ new Label("window.name: "
+ + request.getBrowserDetails().getWindowName()));
+ getContent().addComponent(new Label("UI id: " + getUIId()));
+ }
+ }
+
+ @Override
+ public void init() {
+ super.init();
+ setUiPreserved(true);
+ addUIProvider(new AbstractUIProvider() {
+ @Override
+ public Class<? extends UI> getUIClass(Application application,
+ WrappedRequest request)
+ throws UIRequiresMoreInformationException {
+ return RefreshStateUI.class;
+ }
+ });
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Refreshing the browser window should preserve the state";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(8068);
+ }
+}