aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2013-06-18 12:31:12 +0300
committerJohannes Dahlström <johannesd@vaadin.com>2013-06-18 13:56:57 +0300
commit47c199f6fabe17a39c5a97b196f2e347e0eeada6 (patch)
tree6f2c3a8f6c5a959273a06362fa58ccd17febb38b
parent8669f6adf27244c9ac4906878fb77be3141f9dcf (diff)
downloadvaadin-framework-47c199f6fabe17a39c5a97b196f2e347e0eeada6.tar.gz
vaadin-framework-47c199f6fabe17a39c5a97b196f2e347e0eeada6.zip
Add 'transport' GET parameter to AbstractTestUI (#12094)
* Value can be 'xhr', 'websocket', or 'streaming' * xhr disables push even if already enabled * others set push to automatic if not already set to manual Change-Id: Iaf929bbb78865fa7d832718841e781e76cdf7277
-rw-r--r--uitest/src/com/vaadin/tests/components/AbstractTestUI.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/AbstractTestUI.java b/uitest/src/com/vaadin/tests/components/AbstractTestUI.java
index ec6cf0c57d..f567106d60 100644
--- a/uitest/src/com/vaadin/tests/components/AbstractTestUI.java
+++ b/uitest/src/com/vaadin/tests/components/AbstractTestUI.java
@@ -6,11 +6,14 @@ import com.vaadin.annotations.Widgetset;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.server.WebBrowser;
+import com.vaadin.shared.communication.PushMode;
import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ui.Transport;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
import com.vaadin.ui.Notification;
import com.vaadin.ui.Notification.Type;
+import com.vaadin.ui.PushConfiguration;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
@@ -35,6 +38,8 @@ public abstract class AbstractTestUI extends UI {
warnIfWidgetsetMaybeNotCompiled();
+ setTransport(request);
+
setup(request);
}
@@ -95,6 +100,26 @@ public abstract class AbstractTestUI extends UI {
}
}
+ protected void setTransport(VaadinRequest request) {
+ String transport = request.getParameter("transport");
+ PushConfiguration config = getPushConfiguration();
+ PushMode mode = config.getPushMode();
+
+ if ("xhr".equals(transport)) {
+ config.setPushMode(PushMode.DISABLED);
+ } else if ("websocket".equals(transport)) {
+ if (!mode.isEnabled()) {
+ config.setPushMode(PushMode.AUTOMATIC);
+ }
+ config.setTransport(Transport.WEBSOCKET);
+ } else if ("streaming".equals(transport)) {
+ if (!mode.isEnabled()) {
+ config.setPushMode(PushMode.AUTOMATIC);
+ }
+ config.setTransport(Transport.STREAMING);
+ }
+ }
+
private VerticalLayout layout;
protected VerticalLayout getLayout() {