diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2014-03-17 10:25:15 +0200 |
---|---|---|
committer | Sauli Tähkäpää <sauli@vaadin.com> | 2014-03-18 08:00:45 +0200 |
commit | 3545db2a19397509db1c3fa4ed6f4cc3f85ec1e4 (patch) | |
tree | fba8cef9ac1ad5a42372c17b5531e07caa30d021 /uitest/src/com/vaadin/tests/integration | |
parent | 5441ef061e4b3bf1f6545f829121bcefcb256ef9 (diff) | |
download | vaadin-framework-3545db2a19397509db1c3fa4ed6f4cc3f85ec1e4.tar.gz vaadin-framework-3545db2a19397509db1c3fa4ed6f4cc3f85ec1e4.zip |
Added User-Agent and Screen Width + Height labels to portlet test.
Change-Id: Ic51e0fde622b3075c6956b4c6f3700fbb281c7ba
Diffstat (limited to 'uitest/src/com/vaadin/tests/integration')
-rw-r--r-- | uitest/src/com/vaadin/tests/integration/JSR286Portlet.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/integration/JSR286Portlet.java b/uitest/src/com/vaadin/tests/integration/JSR286Portlet.java index 859175394d..dab19498ab 100644 --- a/uitest/src/com/vaadin/tests/integration/JSR286Portlet.java +++ b/uitest/src/com/vaadin/tests/integration/JSR286Portlet.java @@ -50,6 +50,9 @@ public class JSR286Portlet extends UI { Link portletEdit = new Link(); Link portletMax = new Link(); Link someAction = null; + Label userAgent = new Label(); + Label screenWidth = new Label(); + Label screenHeight = new Label(); private VerticalLayout main = new VerticalLayout(); @Override @@ -69,6 +72,15 @@ public class JSR286Portlet extends UI { userInfo.setContentMode(ContentMode.PREFORMATTED); main.addComponent(userInfo); + userAgent.setCaption("User Agent"); + main.addComponent(userAgent); + + screenWidth.setCaption("Screen width"); + main.addComponent(screenWidth); + + screenHeight.setCaption("Screen height"); + main.addComponent(screenHeight); + tf.setEnabled(false); tf.setImmediate(true); main.addComponent(tf); @@ -100,6 +112,11 @@ public class JSR286Portlet extends UI { VaadinPortletRequest request = (VaadinPortletRequest) VaadinPortletService .getCurrentRequest(); + userAgent.setValue(getPage().getWebBrowser().getBrowserApplication()); + screenWidth.setValue(String.valueOf(getPage().getBrowserWindowWidth())); + screenHeight.setValue(String + .valueOf(getPage().getBrowserWindowHeight())); + boolean inViewMode = (request.getPortletMode() == PortletMode.VIEW); boolean inNormalState = (request.getWindowState() == WindowState.NORMAL); // Portlet up-and-running, enable stuff |