]> source.dussan.org Git - vaadin-framework.git/commitdiff
added test case
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 16 Mar 2010 09:08:21 +0000 (09:08 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 16 Mar 2010 09:08:21 +0000 (09:08 +0000)
svn changeset:11904/svn branch:6.3

tests/src/com/vaadin/tests/layouts/CssLayoutSizeChangePropagation.java [new file with mode: 0644]

diff --git a/tests/src/com/vaadin/tests/layouts/CssLayoutSizeChangePropagation.java b/tests/src/com/vaadin/tests/layouts/CssLayoutSizeChangePropagation.java
new file mode 100644 (file)
index 0000000..a464e9b
--- /dev/null
@@ -0,0 +1,61 @@
+package com.vaadin.tests.layouts;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.CssLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+
+public class CssLayoutSizeChangePropagation extends TestBase {
+
+    @Override
+    protected void setup() {
+        getLayout().setSizeFull();
+        final VerticalLayout sp = new VerticalLayout();
+
+        sp.setHeight("100%");
+
+        final CssLayout cssLayout = new CssLayout() {
+            @Override
+            protected String getCss(Component c) {
+                return "background-color: yellow;";
+            }
+        };
+        cssLayout.setSizeFull();
+        Label l = new Label("bö");
+        l.setSizeFull();
+        cssLayout.addComponent(l);
+
+        sp.addComponent(cssLayout);
+
+        Button button = new Button("b");
+        button.addListener(new ClickListener() {
+            boolean bool = true;
+
+            public void buttonClick(ClickEvent event) {
+                sp.setExpandRatio(cssLayout, bool ? 1 : 0);
+                bool = !bool;
+            }
+        });
+
+        sp.addComponent(button);
+        sp.setExpandRatio(button, 1);
+
+        getLayout().addComponent(sp);
+
+    }
+
+    @Override
+    protected String getDescription() {
+        return "Upper part of view should become yellow on button click.";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return 4351;
+    }
+
+}