summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/layouts
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2013-05-10 16:53:33 +0300
committerLeif Åstrand <leif@vaadin.com>2013-05-10 16:53:33 +0300
commit42d94768bfacb3d831e125ae33eeb4b9fa1d8a53 (patch)
treea09cd9d99d1be99dd6600a90db07fb08d15af28a /uitest/src/com/vaadin/tests/layouts
parent762c924a8bf05f57b8af7108d7bb6a9c59dcc6c6 (diff)
parent19e27a15ca765de477fbe929a1cb6a7412c523f7 (diff)
downloadvaadin-framework-42d94768bfacb3d831e125ae33eeb4b9fa1d8a53.tar.gz
vaadin-framework-42d94768bfacb3d831e125ae33eeb4b9fa1d8a53.zip
Merge changes from origin/7.0
7d9f544 Test for #11396 (merged from 6.8 branch). Depends on a blur event so cannot be autotested with TB. 1b18807 Remove pre-loader element after pre-loading, fixes #10863 ce9c818 Instead of applying workaround to the root panel, apply it to the sub window content element instead to prevent scrolling of the document when a sub window is removed. #11713 (#10776) 3f5d022 Liferay 6.2 compatibility (#11751) ffd1c1b Don't ignore child component margins in AbstractOrderedLayout (#11553) 62ae5e1 More verbose output from running Jetty 21d9b67 Add a large number of debug calls to VFilterSelect (disabled by default) bdb7931 Merge test for #11623 to 7.0. 19e27a1 Move suggestion popup width calculation from connector to VFilterSelect Change-Id: I2d980126599e55fa5e4f6ec523dca16ba54107b5
Diffstat (limited to 'uitest/src/com/vaadin/tests/layouts')
-rw-r--r--uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.html27
-rw-r--r--uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.java85
2 files changed, 112 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.html b/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.html
new file mode 100644
index 0000000000..3132bdd16d
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.html
@@ -0,0 +1,27 @@
+<?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:8070/" />
+<title>MarginWithExpandRatio</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">MarginWithExpandRatio</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/MarginWithExpandRatio?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>no-overflow</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.java b/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.java
new file mode 100644
index 0000000000..f6ee26e86f
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.tests.layouts;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.tests.util.TestUtils;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.VerticalLayout;
+
+public class MarginWithExpandRatio extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ TestUtils.injectCSS(this,
+ ".hugemargin { margin: 10px 20px !important; }");
+
+ HorizontalLayout hl = new HorizontalLayout();
+ addLayoutTest(hl);
+ hl.setExpandRatio(hl.getComponent(0), 1.0f);
+ hl.setExpandRatio(hl.getComponent(2), 0.5f);
+ VerticalLayout vl = new VerticalLayout();
+ addLayoutTest(vl);
+ vl.setExpandRatio(vl.getComponent(0), 1.0f);
+ vl.setExpandRatio(vl.getComponent(2), 0.5f);
+
+ GridLayout gl = new GridLayout(2, 1);
+ addLayoutTest(gl);
+ gl.setColumnExpandRatio(0, 1.0f);
+ gl.setRowExpandRatio(0, 1.0f);
+ gl.setColumnExpandRatio(1, 0.5f);
+ gl.setRowExpandRatio(1, 0.5f);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Layout content overflows if CSS margin used with expand ratio";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 11553;
+ }
+
+ private void addLayoutTest(Layout l) {
+ l.setSizeFull();
+
+ Label lbl = new Label("First (expand ratio 1)");
+ lbl.setSizeUndefined();
+ l.addComponent(lbl);
+
+ lbl = new Label("Second (margin 10px)");
+ lbl.setSizeUndefined();
+ lbl.addStyleName("hugemargin");
+ l.addComponent(lbl);
+
+ lbl = new Label("Third (margin+xr)");
+ lbl.setSizeUndefined();
+ lbl.addStyleName("hugemargin");
+ l.addComponent(lbl);
+
+ Panel p = new Panel(l.getClass().getSimpleName(), l);
+ p.setWidth("600px");
+ p.setHeight("200px");
+ addComponent(p);
+ }
+}