summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2015-08-28 17:13:05 +0300
committerArtur Signell <artur@vaadin.com>2015-08-31 13:11:04 +0300
commit8b30dbf46f6d992d2e6543d1e8fc16464e2e1533 (patch)
tree3ee0939d63107821d7b729b0952e22c160ac6dee /uitest
parentf17408b5e0bce769404a973c57d088bb64cf0e94 (diff)
downloadvaadin-framework-8b30dbf46f6d992d2e6543d1e8fc16464e2e1533.tar.gz
vaadin-framework-8b30dbf46f6d992d2e6543d1e8fc16464e2e1533.zip
Handle unparsable JSON as invalid content (#11733)
Change-Id: I67ed5e78b93ff0fe20d861105a0aa01ae6ccb2e6
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/application/CommErrorEmulatorUI.java8
-rw-r--r--uitest/src/com/vaadin/tests/components/AbstractTestUI.java3
2 files changed, 5 insertions, 6 deletions
diff --git a/uitest/src/com/vaadin/tests/application/CommErrorEmulatorUI.java b/uitest/src/com/vaadin/tests/application/CommErrorEmulatorUI.java
index da03e78f1f..080d36fa48 100644
--- a/uitest/src/com/vaadin/tests/application/CommErrorEmulatorUI.java
+++ b/uitest/src/com/vaadin/tests/application/CommErrorEmulatorUI.java
@@ -20,8 +20,6 @@ import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
-import com.vaadin.shared.communication.PushMode;
-import com.vaadin.shared.ui.ui.Transport;
import com.vaadin.tests.components.AbstractTestUIWithLog;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
@@ -69,12 +67,10 @@ public class CommErrorEmulatorUI extends AbstractTestUIWithLog {
String transport = request.getParameter("transport");
if ("websocket".equalsIgnoreCase(transport)) {
- getPushConfiguration().setPushMode(PushMode.AUTOMATIC);
- getPushConfiguration().setTransport(Transport.WEBSOCKET);
log("Using websocket");
+ } else if ("websocket-xhr".equalsIgnoreCase(transport)) {
+ log("Using websocket for push only");
} else if ("long-polling".equalsIgnoreCase(transport)) {
- getPushConfiguration().setPushMode(PushMode.AUTOMATIC);
- getPushConfiguration().setTransport(Transport.LONG_POLLING);
log("Using long-polling");
} else {
log("Using XHR");
diff --git a/uitest/src/com/vaadin/tests/components/AbstractTestUI.java b/uitest/src/com/vaadin/tests/components/AbstractTestUI.java
index 98b0f63ce1..296e68008e 100644
--- a/uitest/src/com/vaadin/tests/components/AbstractTestUI.java
+++ b/uitest/src/com/vaadin/tests/components/AbstractTestUI.java
@@ -124,6 +124,9 @@ public abstract class AbstractTestUI extends UI {
config.setPushMode(PushMode.DISABLED);
} else if ("websocket".equals(transport)) {
enablePush(Transport.WEBSOCKET);
+ } else if ("websocket-xhr".equals(transport)) {
+ enablePush(Transport.WEBSOCKET);
+ getPushConfiguration().setAlwaysUseXhrForServerRequests(true);
} else if ("streaming".equals(transport)) {
enablePush(Transport.STREAMING);
} else if ("long-polling".equals(transport)) {