diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2013-05-02 13:58:36 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-05-02 11:29:34 +0000 |
commit | 087756f1a6472af100686fdfebd7aa273faa0059 (patch) | |
tree | 8c41ff45042663b0865f9aef24303d4f7dcec53e /uitest/src | |
parent | 79e9ddc5247ae154d5f63ceeeb02afb293dbc91f (diff) | |
download | vaadin-framework-087756f1a6472af100686fdfebd7aa273faa0059.tar.gz vaadin-framework-087756f1a6472af100686fdfebd7aa273faa0059.zip |
Allow setting push mode in UI.init (#11739)
Change-Id: Ied24bc42a25800033351fcbacdc5fc5e0be8eda1
Diffstat (limited to 'uitest/src')
-rw-r--r-- | uitest/src/com/vaadin/tests/push/TogglePush.java | 3 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/push/TogglePushInInit.html | 69 |
2 files changed, 72 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/push/TogglePush.java b/uitest/src/com/vaadin/tests/push/TogglePush.java index 24358e648a..37687260dd 100644 --- a/uitest/src/com/vaadin/tests/push/TogglePush.java +++ b/uitest/src/com/vaadin/tests/push/TogglePush.java @@ -22,6 +22,9 @@ public class TogglePush extends AbstractTestUI { updateCounter(); addComponent(counterLabel); + setPushMode("disabled".equals(request.getParameter("push")) ? PushMode.DISABLED + : PushMode.AUTOMATIC); + CheckBox pushSetting = new CheckBox("Push enabled"); pushSetting.setValue(Boolean.valueOf(getPushMode().isEnabled())); pushSetting.setImmediate(true); diff --git a/uitest/src/com/vaadin/tests/push/TogglePushInInit.html b/uitest/src/com/vaadin/tests/push/TogglePushInInit.html new file mode 100644 index 0000000000..c735f225e1 --- /dev/null +++ b/uitest/src/com/vaadin/tests/push/TogglePushInInit.html @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="http://localhost:8071/" /> +<title>TogglePushInInit</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">TogglePushInInit</td></tr> +</thead><tbody> +<!--Open with push disabled--> +<tr> + <td>open</td> + <td>/run-push/com.vaadin.tests.push.TogglePush?restartApplication&push=disabled</td> + <td></td> +</tr> +<tr> + <td>assertValue</td> + <td>vaadin=runpushcomvaadintestspushTogglePush::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VCheckBox[0]/domChild[0]</td> + <td>off</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runpushcomvaadintestspushTogglePush::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>pause</td> + <td>2000</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runpushcomvaadintestspushTogglePush::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td> + <td>Counter has been updated 0 times</td> +</tr> +<!--Open with push enabled--> +<tr> + <td>open</td> + <td>/run-push/com.vaadin.tests.push.TogglePush?restartApplication&push=enabled</td> + <td></td> +</tr> +<tr> + <td>assertValue</td> + <td>vaadin=runpushcomvaadintestspushTogglePush::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VCheckBox[0]/domChild[0]</td> + <td>on</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runpushcomvaadintestspushTogglePush::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>pause</td> + <td>2000</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runpushcomvaadintestspushTogglePush::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td> + <td>Counter has been updated 1 times</td> +</tr> + +</tbody></table> +</body> +</html> |