]> source.dussan.org Git - vaadin-framework.git/commitdiff
Merged changes to 6.7
authorHenri Sara <henri.sara@itmill.com>
Wed, 27 Jul 2011 08:15:35 +0000 (08:15 +0000)
committerHenri Sara <henri.sara@itmill.com>
Wed, 27 Jul 2011 08:15:35 +0000 (08:15 +0000)
svn changeset:19972/svn branch:6.7

16 files changed:
WebContent/VAADIN/themes/reindeer/table/table.css
WebContent/VAADIN/themes/sampler/icons/sampleicons/75-MenuBarCheckableItems.gif [new file with mode: 0644]
build/build.xml
src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
src/com/vaadin/terminal/gwt/client/CSSRule.java
src/com/vaadin/terminal/gwt/client/VDebugConsole.java
src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
src/com/vaadin/terminal/gwt/client/ui/VTree.java
src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java
src/com/vaadin/ui/AbstractTextField.java
tests/integration_tests.xml
tests/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.html [new file with mode: 0644]
tests/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java [new file with mode: 0644]
tests/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.html [new file with mode: 0644]
tests/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java [new file with mode: 0644]
tests/test.xml

index 8ac40ba1163316dd887591b4f5ceb2f970f7f633..156c1c3e500c5c32220e18250d79763c53e17bc9 100644 (file)
        line-height: normal;
 }
 
+.v-ie6 .v-table-header-wrap,
+.v-ie6 .v-table-footer-wrap,
+.v-ie6 .v-table-column-selector{
+       /* Fixes IE6 overflow bug #7314 which causes Table headers to overflow and cover the column selector. */
+       position:relative;
+}
+
+.v-ie6 .v-table.v-disabled,
+.v-ie7 .v-table.v-disabled{
+       /* Fixes ie issue #7324 where disabled shim does not cover table body */ 
+       position:relative;
+}
+
 .v-table-footer-wrap,
 .white .v-table-footer-wrap {
        text-transform: none;
@@ -40,6 +53,7 @@
        padding-right: 7px;
 }
 
+
 .v-table-header,
 .v-table-footer,
 .v-table-footer table {
diff --git a/WebContent/VAADIN/themes/sampler/icons/sampleicons/75-MenuBarCheckableItems.gif b/WebContent/VAADIN/themes/sampler/icons/sampleicons/75-MenuBarCheckableItems.gif
new file mode 100644 (file)
index 0000000..f59714c
Binary files /dev/null and b/WebContent/VAADIN/themes/sampler/icons/sampleicons/75-MenuBarCheckableItems.gif differ
index d6bdfa6dd136847219c5554d338de327e6cbe555..3197f15c5605ca7dc89b6df7446b5dd47959dd25 100644 (file)
     <target name="package-test" depends="clean-result, nightly-init, package-init, init, build, docs, internal-package-zip, nightly-publish">
     </target>
 
+    <!-- Locations of Ant task JARs - build properties not yet read at this point -->
+    <property name="ant.task.jar.antcontrib" value="build/lib/ant-contrib-1.0b3.jar" />
+    <property name="ant.task.jar.maven" value="build/lib/maven-ant-tasks-2.0.10.jar" />
+
     <!-- ant contrib required for flow control (for loop, if, property override)   -->
     <!-- Note that we have to use a namespace to avoid clash when running sub-ant. -->
     <taskdef uri="antlib:net.sf.antcontrib" resource="net/sf/antcontrib/antlib.xml">
         <classpath>
-            <pathelement location="build/lib/ant-contrib-1.0b3.jar" />
+            <pathelement location="${ant.task.jar.antcontrib}" />
         </classpath>
     </taskdef>
 
     <!-- ant contrib for Maven integration -->
-    <path id="maven-ant-tasks.classpath" path="build/lib/maven-ant-tasks-2.0.10.jar" />
+    <path id="maven-ant-tasks.classpath" path="${ant.task.jar.maven}" />
     <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
              uri="antlib:org.apache.maven.artifact.ant"
              classpathref="maven-ant-tasks.classpath" />
 
     <target name="remove-widgetset-gwt-tmp">
         <echo>Removing widgetset temp files</echo>
-        <delete dir="${output-dir}/WebContent/VAADIN/widgetsets/.gwt-tmp" includeemptydirs="true"/>
+        <delete dir="${widgetsets-output-dir}/.gwt-tmp" includeemptydirs="true"/>
+       <!-- This is generated by GWT 2.3+ for rpcPolicyManifest and symbolMaps, cannot disable -->
+        <delete dir="${widgetsets-output-dir}/WEB-INF" includeemptydirs="true" failonerror="false" />
     </target>
 
     <!-- Note: Probably not needed any longer as all sources need to be compiled. -->
     <!-- ================================================================== -->
 
     <!-- Main target for the custom build. -->
-    <target name="custom-build" depends="clean-result, custom-build-init, nightly-init, package-init, init, compile-server-side, compile-client-side, vaadin.jar, vaadin-sources.jar">
+    <target name="custom-build" depends="clean-result, custom-build-init, nightly-init, package-init, init, build">
     </target>
 
 
                        <property file="${build.properties.file}" />
                                <property name="version" value="${vaadin.version}"/>
                        <property name="version.full" value="${version}.custom-${build.date.compact}"/>
-                               <property name="compile.only.default-widgetset" value="1"/>
+                               <!-- <property name="compile.only.default-widgetset" value="1"/> -->
                        </then>
                        <!-- Otherwise version and snapshot.repository.url come from target "init" -->
                </antcontrib:if>
         <fail unless="com.vaadin.testbench.deployment.url" message="The 'com.vaadin.testbench.deployment.url' property must be defined."/>
         <fail unless="com.vaadin.testbench.lib.dir" message="The 'com.vaadin.testbench.lib.dir' property must be defined."/>
 
+       <property name="com.vaadin.testbench.screenshot.block.error" value="0.025"/>
+       <property name="com.vaadin.testbench.debug" value="false"/>
         <property name="package.name" value="${base-name}"/>
 
         <!-- Only Linux tests allowed. TODO: Generalize this. -->
             <!-- "tests" classes after unpacking the package.          -->
             <property name="output-dir" value="${output-dir}"/>
 
-               <!-- Convert some tests to run multiple times if failed. -->
-            <property name="create.retry.tests" value="1"/>
-               <property name="retries" value="3"/>
+               <!-- Convert tests to run multiple times if failed. -->
+               <property name="retries" value="2"/>
                
             <property name="package.filename" value="${package.filename}"/>
             <property name="testing.testarea" value="/tmp/testarea"/>
             <property name="com.vaadin.testbench.tester.host" value="${com.vaadin.testbench.tester.host}"/>
             <property name="com.vaadin.testbench.deployment.url" value="${com.vaadin.testbench.deployment.url}"/>
             <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}"/>
+            <property name="com.vaadin.testbench.debug" value="${com.vaadin.testbench.debug}"/>
+            <property name="com.vaadin.testbench.screenshot.block.error" value="${com.vaadin.testbench.screenshot.block.error}"/>
         </ant>
     </target>
 
index 4b6194b79bcf30998c050a69616d2b65fac20a9a..6787b360224244e727702e3165286495d44695f3 100644 (file)
@@ -223,7 +223,6 @@ public class ApplicationConfiguration implements EntryPoint {
             }
         }
 
-        deferredWidgetLoadLoop.scheduleRepeating(100);
     }
 
     /**
@@ -257,6 +256,7 @@ public class ApplicationConfiguration implements EntryPoint {
             runningApplications.add(a);
             return true;
         } else {
+            deferredWidgetLoader = new DeferredWidgetLoader();
             return false;
         }
     }
@@ -361,6 +361,8 @@ public class ApplicationConfiguration implements EntryPoint {
                 cmd.execute();
             }
             callbacks.clear();
+        } else if(widgetsLoading == 0 && deferredWidgetLoader != null) {
+            deferredWidgetLoader.trigger();
         }
 
     }
@@ -368,22 +370,44 @@ public class ApplicationConfiguration implements EntryPoint {
     /*
      * This loop loads widget implementation that should be loaded deferred.
      */
-    private static final Timer deferredWidgetLoadLoop = new Timer() {
+    static class DeferredWidgetLoader extends Timer {
         private static final int FREE_LIMIT = 4;
+        private static final int FREE_CHECK_TIMEOUT = 100;
 
         int communicationFree = 0;
         int nextWidgetIndex = 0;
+        private boolean pending;
+        
+        public DeferredWidgetLoader() {
+            schedule(5000);
+        }
+
+        public void trigger() {
+            if(!pending) {
+                schedule(FREE_CHECK_TIMEOUT);
+            }
+        }
+        
+        @Override
+        public void schedule(int delayMillis) {
+            super.schedule(delayMillis);
+            pending = true;
+        }
 
         @Override
         public void run() {
+            pending = false;
             if (!isBusy()) {
                 Class<? extends Paintable> nextType = getNextType();
                 if (nextType == null) {
                     // ensured that all widgets are loaded
-                    cancel();
+                    deferredWidgetLoader = null;
                 } else {
+                    communicationFree = 0;
                     widgetSet.loadImplementation(nextType);
                 }
+            } else {
+                schedule(FREE_CHECK_TIMEOUT);
             }
         }
 
@@ -400,21 +424,23 @@ public class ApplicationConfiguration implements EntryPoint {
         private boolean isBusy() {
             if (widgetsLoading > 0) {
                 communicationFree = 0;
-                return false;
+                return true;
             }
             for (ApplicationConnection app : runningApplications) {
                 if (app.hasActiveRequest()) {
                     // if an UIDL request or widget loading is active, mark as
                     // busy
                     communicationFree = 0;
-                    return false;
+                    return true;
                 }
             }
             communicationFree++;
             return communicationFree < FREE_LIMIT;
         }
-    };
-
+    }
+    
+    private static DeferredWidgetLoader deferredWidgetLoader;
+   
     public void onModuleLoad() {
 
         // Enable IE6 Background image caching
index 5c7758e0dd1e0b01fe0ee723bc3df2ef8fd147ab..97604d242e0471b8f010fb5f57f55babe0c370e3 100644 (file)
@@ -72,7 +72,7 @@ public class CSSRule {
     var j = theRules.length;
     for(var i=0; i<j; i++) {
     var r = theRules[i];
-    if(r.type == 1 || sheet.imports) {
+    if(r.type == 1 || sheet.imports) {
     var selectors = r.selectorText.toLowerCase().split(",");
     var n = selectors.length;
     for(var m=0; m<n; m++) {
index ec172f67f8affe1834d1c0ad21c7b35f4b1aa702..5d7c0be43798dacd49276b8fc63a9eae26854558 100755 (executable)
@@ -56,7 +56,7 @@ import com.vaadin.terminal.gwt.client.ui.VOverlay;
  * This implementation can be overridden with GWT deferred binding.
  * 
  */
-public final class VDebugConsole extends VOverlay implements Console {
+public class VDebugConsole extends VOverlay implements Console {
 
     private static final String POS_COOKIE_NAME = "VDebugConsolePos";
 
@@ -287,11 +287,7 @@ public final class VDebugConsole extends VOverlay implements Console {
 
     protected void remoteLog(String msg) {
         msgQueue.add(msg);
-        if (msg.length() > 4) {
-            doSend.execute();
-        } else {
-            sendToRemoteLog.trigger();
-        }
+        sendToRemoteLog.trigger();
     }
 
     /**
index 1226c5ae79c1345ae356576a5a57271b7dbb4743..8f8958d365388dda688a243d89afa119bc8f76a8 100644 (file)
@@ -807,6 +807,18 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
 
         enabled = !uidl.hasAttribute("disabled");
 
+        if (BrowserInfo.get().isIE8() && !enabled) {
+            /*
+             * The disabled shim will not cover the table body if it is
+             * relative in IE8. See #7324
+             */
+            scrollBodyPanel.getElement().getStyle()
+                    .setPosition(Position.STATIC);
+        } else if (BrowserInfo.get().isIE8()) {
+            scrollBodyPanel.getElement().getStyle()
+                    .setPosition(Position.RELATIVE);
+        }
+
         this.client = client;
         paintableId = uidl.getStringAttribute("id");
         immediate = uidl.getBooleanAttribute("immediate");
index ef08e81e10ee29ac20179787cd7cedf793326919..eb8a2e63c5f878a22afb5f83a924ebdec4d4e1d1 100644 (file)
@@ -511,9 +511,27 @@ public class VTree extends FocusElementPanel implements Paintable,
      * Sends the selection to the server
      */
     private void sendSelectionToServer() {
-        client.updateVariable(paintableId, "selected", selectedIds
-                .toArray(new String[selectedIds.size()]), immediate);
-        selectionHasChanged = false;
+        Command command = new Command() {
+            public void execute() {
+                client.updateVariable(paintableId, "selected",
+                        selectedIds.toArray(new String[selectedIds.size()]),
+                        immediate);
+                selectionHasChanged = false;
+            }
+        };
+
+        /*
+         * Delaying the sending of the selection in webkit to ensure the
+         * selection is always sent when the tree has focus and after click
+         * events have been processed. This is due to the focusing
+         * implementation in FocusImplSafari which uses timeouts when focusing
+         * and blurring.
+         */
+        if (BrowserInfo.get().isWebkit()) {
+            Scheduler.get().scheduleDeferred(command);
+        } else {
+            command.execute();
+        }
     }
 
     /**
index a3f1c598462245c037280951bfde7cf49a994241..7ad790e25e7c8b011aebd1c70d45d5b6f3295671 100644 (file)
@@ -8,6 +8,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.TreeSet;
@@ -244,10 +245,16 @@ public class WidgetMapGenerator extends Generator {
         boolean first = true;
 
         ArrayList<Class<? extends Paintable>> lazyLoadedWidgets = new ArrayList<Class<? extends Paintable>>();
+        
+        HashSet<Class<? extends com.vaadin.terminal.gwt.client.Paintable>> widgetsWithInstantiator = new HashSet<Class<? extends com.vaadin.terminal.gwt.client.Paintable>>();
+        
         for (Class<? extends Paintable> class1 : paintablesHavingWidgetAnnotation) {
             ClientWidget annotation = class1.getAnnotation(ClientWidget.class);
             Class<? extends com.vaadin.terminal.gwt.client.Paintable> clientClass = annotation
                     .value();
+            if(widgetsWithInstantiator.contains(clientClass)) {
+                continue;
+            }
             if (clientClass == VView.class) {
                 // VView's are not instantiated by widgetset
                 continue;
@@ -288,6 +295,7 @@ public class WidgetMapGenerator extends Generator {
                 sourceWriter.print(");");
             }
             sourceWriter.print("}");
+            widgetsWithInstantiator.add(clientClass);
         }
 
         sourceWriter.println("}");
index 622b8d18d9fdedc05c040a547135a4bcd198e4da..4ed76d367bdf8a3573d3e3cb42edde37a23a42f4 100644 (file)
@@ -1,4 +1,4 @@
-/*
+/* 
 @ITMillApache2LicenseForJavaFiles@
  */
 
@@ -123,20 +123,7 @@ public abstract class AbstractTextField extends AbstractField implements
             throw new IllegalStateException(
                     "Null values are not allowed if the null-representation is null");
         }
-
-        if (requestRepaintInTextChangeEvent && !valueChangeInTextChangeEvent) {
-            /*
-             * If the repaint occurred in a text change event then we do not
-             * want to send back the old value since it will just overwrite the
-             * typed value so we send the last known value instead which is
-             * updated by the text change event.
-             */
-            target.addVariable(this, "text", lastKnownTextContent);
-        } else {
-            target.addVariable(this, "text", value);
-        }
-        requestRepaintInTextChangeEvent = false;
-        valueChangeInTextChangeEvent = false;
+        target.addVariable(this, "text", value);
 
         if (selectionPosition != -1) {
             target.addAttribute("selpos", selectionPosition);
@@ -184,22 +171,6 @@ public abstract class AbstractTextField extends AbstractField implements
         }
     }
 
-    /**
-     * Flag for monitoring if a repaint gets requested in a text change event
-     */
-    private boolean requestRepaintInTextChangeEvent = false;
-
-    @Override
-    public void requestRepaint() {
-        if (textChangeEventPending) {
-            /*
-             * Textchange event listener triggered this repaint
-             */
-            requestRepaintInTextChangeEvent = true;
-        }
-        super.requestRepaint();
-    }
-
     @Override
     public void changeVariables(Object source, Map<String, Object> variables) {
         changingVariables = true;
@@ -467,26 +438,13 @@ public abstract class AbstractTextField extends AbstractField implements
 
     private void firePendingTextChangeEvent() {
         if (textChangeEventPending) {
-            fireEvent(new TextChangeEventImpl(this));
             textChangeEventPending = false;
+            fireEvent(new TextChangeEventImpl(this));
         }
     }
 
-    /**
-     * Flag for monitoring if the value got changed in a TextChangeEvent
-     * listener
-     */
-    protected boolean valueChangeInTextChangeEvent = false;
-
     @Override
     protected void setInternalValue(Object newValue) {
-        if (textChangeEventPending) {
-            /*
-             * Value changed in a TextChangeEvent listener
-             */
-            valueChangeInTextChangeEvent = true;
-        }
-
         if (changingVariables && !textChangeEventPending) {
             /*
              * Fire a "simulated" text change event before value change event if
index 9caea35270438c2c75cc7ee1c3dacd77d07e373f..b183a317a39389ef28983c351bc34d1aaf4470dd 100644 (file)
@@ -53,6 +53,7 @@
                        <property name="browsers" value="${test_browsers}" />\r
                        <property name="testfiles" value="${testfiles}" />\r
                        <property name="test-output-dir" value="../build/integration-test-output" />\r
+                       <property name="retries" value="0" />\r
                        \r
                        <fileset dir="." includes="test.xml" />\r
                </subant>\r
diff --git a/tests/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.html b/tests/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.html
new file mode 100644 (file)
index 0000000..8795ad1
--- /dev/null
@@ -0,0 +1,32 @@
+<?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="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td>/run/com.vaadin.tests.components.formlayout.TableInFormLayoutCausesScrolling?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentsformlayoutTableInFormLayoutCausesScrolling::/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+       <td>12,13</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>should-be-scrolled-up</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java b/tests/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java
new file mode 100644 (file)
index 0000000..157772f
--- /dev/null
@@ -0,0 +1,45 @@
+package com.vaadin.tests.components.formlayout;\r
+\r
+import com.vaadin.tests.components.AbstractTestCase;\r
+import com.vaadin.ui.FormLayout;\r
+import com.vaadin.ui.Table;\r
+import com.vaadin.ui.TextField;\r
+import com.vaadin.ui.Window;\r
+\r
+public class TableInFormLayoutCausesScrolling extends AbstractTestCase {\r
+\r
+    @Override\r
+    public void init() {\r
+        // Window Initialization.\r
+        final Window window = new Window("Main Window");\r
+        setMainWindow(window);\r
+\r
+        // FormLayout creation\r
+        final FormLayout fl = new FormLayout();\r
+        window.setContent(fl);\r
+\r
+        // Add 20 TextField\r
+        for (int i = 20; i-- > 0;) {\r
+            fl.addComponent(new TextField());\r
+        }\r
+\r
+        // Add 1 selectable table with some items\r
+        final Table table = new Table();\r
+        table.setSelectable(true);\r
+        table.addContainerProperty("item", String.class, "");\r
+        for (int i = 50; i-- > 0;) {\r
+            table.addItem(new String[] { "item" + i }, i);\r
+        }\r
+        window.addComponent(table);\r
+    }\r
+\r
+    @Override\r
+    protected String getDescription() {\r
+        return "Clicking in the Table should not cause the page to scroll";\r
+    }\r
+\r
+    @Override\r
+    protected Integer getTicketNumber() {\r
+        return 7309;\r
+    }\r
+}
\ No newline at end of file
diff --git a/tests/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.html b/tests/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.html
new file mode 100644 (file)
index 0000000..f0d837d
--- /dev/null
@@ -0,0 +1,36 @@
+<?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://artur.virtuallypreinstalled.com/" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td>/run/com.vaadin.tests.components.orderedlayout.VerticalLayoutWidthCalculation?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runcomvaadintestscomponentsorderedlayoutVerticalLayoutWidthCalculation::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runcomvaadintestscomponentsorderedlayoutVerticalLayoutWidthCalculation::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>window-sized-to-one-textfield</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/tests/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java b/tests/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java
new file mode 100644 (file)
index 0000000..f59b940
--- /dev/null
@@ -0,0 +1,63 @@
+package com.vaadin.tests.components.orderedlayout;
+
+import com.vaadin.tests.components.AbstractTestCase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+
+public class VerticalLayoutWidthCalculation extends AbstractTestCase {
+    @Override
+    public void init() {
+        final Window mainWindow = new Window("Vaadintest Application");
+        mainWindow.addWindow(createSubWindow());
+        setMainWindow(mainWindow);
+
+    }
+
+    private Window createSubWindow() {
+        HorizontalLayout hl = new HorizontalLayout();
+
+        VerticalLayout vlTF1 = new VerticalLayout();
+        vlTF1.setSizeUndefined();
+        final TextField tf1 = new TextField("Text1");
+        tf1.setSizeUndefined();
+        vlTF1.addComponent(tf1);
+        hl.addComponent(vlTF1);
+
+        VerticalLayout vlTF2 = new VerticalLayout();
+        vlTF2.setSizeUndefined();
+        final TextField tf2 = new TextField("Text2");
+        tf2.setVisible(false);
+        tf2.setSizeUndefined();
+        vlTF2.addComponent(tf2);
+        hl.addComponent(vlTF2);
+
+        Window wnd = new Window("Test");
+        wnd.getContent().setSizeUndefined();
+        wnd.addComponent(hl);
+        Button btn = new Button("Show/hide");
+        btn.addListener(new Button.ClickListener() {
+
+            public void buttonClick(ClickEvent event) {
+                tf2.setVisible(!tf2.isVisible());
+            }
+        });
+        wnd.addComponent(btn);
+
+        return wnd;
+    }
+
+    @Override
+    protected String getDescription() {
+        return "The second TextField is initially invisible. Make it visible and then hide it again. You should end up with the same result as initially.";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return 7260;
+    }
+
+}
index 512db895a9b84392ae6695d5ec490e0114396550..7f6331ec8e96df9181d36ff113a1de95caab8136 100644 (file)
@@ -5,11 +5,14 @@
        <!-- Configuration                                                      -->
        <!-- ================================================================== -->
        <!-- Browsers to use for testing -->
-       <property name="browsers-windows" value="winxp-ie6,winxp-ie7,winxp-ie8,win7-ie9,winxp-firefox36,winxp-firefox4,winxp-safari4,winxp-safari5,winxp-googlechrome-stable,winxp-opera1060,winxp-opera11" />
+       <property name="browsers-windows" value="winxp-ie6,winxp-ie7,winxp-ie8,win7-ie9,winxp-firefox36,winxp-firefox4,winxp-firefox5,winxp-safari4,winxp-safari5,winxp-googlechrome-stable,winxp-opera1060,winxp-opera11" />
        <property name="browsers-linux" value="linux-firefox3,linux-opera10,linux-googlechrome8" />
        <property name="browsers-mac" value="osx-firefox3,osx-opera10,osx-googlechrome8,osx-safari4,osx-safari5" />
 
        <property name="browsers" value="${browsers-windows}" />
+       
+       <!-- Number of times to retry a test if it fails -->
+       <property name="retries" value="2" />
 
        <!-- Screen shot base directory -->
        <fail unless="com.vaadin.testbench.screenshot.directory" message="The 'com.vaadin.testbench.screenshot.directory' property must be defined." />
@@ -20,6 +23,9 @@
        <!-- Host running Testbench Hub -->
        <property name="com.vaadin.testbench.tester.host" value="testbench-hub.intra.itmill.com" />
 
+       <property name="com.vaadin.testbench.screenshot.block.error" value="0.025"/>
+       <property name="com.vaadin.testbench.debug" value="false"/>
+       
        <!-- Temporary output directory, created and removed by this script -->
        <!-- <property name="test-output-dir" value="../build/test-output" /> -->
        <fail unless="test-output-dir" message="The 'test-output-dir' property must be defined." />
                <exclude name="tests/integration-testscripts/**" />
        </fileset>
 
-       <!-- fileset containing tests to retry -->
-       <fileset dir=".." id="html-retry-files-ie6">
-               <include name="tests/**/SubWindows**.html" />
-       </fileset>
-
        <!-- This target converts HTML tests files to java junit tests. One test file for each browser is created. -->
        <target name="create-tests" depends="remove-temp-testclasses" if="server.start.succeeded">
                <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
 
                <java classname="com.vaadin.testbench.util.TestConverter" classpathref="classpath" fork="true">
+                       <sysproperty key="com.vaadin.testbench.test.retries" value="${retries}" />
                        <jvmarg value="-Duser.language=en"/>
                        <jvmarg value="-Duser.country=US"/>
                        <arg value="${test-output-dir}" />
        </target>
 
 
-       <target name="create-retry-tests" if="create.retry.tests">
-               <antcall target="convert-retry-test">
-                       <param name="browser" value="winxp-ie6" />
-                       <param name="testfile-name" value="html-retry-files-ie6" />
-               </antcall>
-       </target>
-
-       <!-- Target converts test files so that the whole test can be re run 'retries' times -->
-       <target name="convert-retry-test" if="retries">
-               <pathconvert pathsep=" " property="testfile" refid="${testfile-name}" />
-
-               <java classname="com.vaadin.testbench.util.TestConverter" classpathref="classpath">
-                       <sysproperty key="com.vaadin.testbench.test.retries" value="${retries}" />
-                       <jvmarg value="-Duser.language=en"/>
-                       <jvmarg value="-Duser.country=US"/>
-                       <arg value="${test-output-dir}" />
-                       <arg value="${browser}" />
-                       <arg line="${testfile}" />
-               </java>
-
-       </target>
-
        <!-- This target complies the generated java junit tests. -->
-       <target name="compile-tests" depends="create-tests, create-retry-tests">
+       <target name="compile-tests" depends="create-tests">
                <mkdir dir="${class-dir}" />
                <javac srcdir="${test-output-dir}" destdir="${class-dir}" debug="on" fork="yes" failonerror="false" encoding="UTF8">
                        <classpath>
                        <jvmarg value="-Dcom.vaadin.testbench.screenshot.directory=${com.vaadin.testbench.screenshot.directory}" />
                        <!-- Resolution for screenshots -->
                        <jvmarg value="-Dcom.vaadin.testbench.screenshot.resolution=${com.vaadin.testbench.screenshot.resolution}" />
+                       <jvmarg value="-Dcom.vaadin.testbench.debug=${com.vaadin.testbench.debug}" />
+                       <jvmarg value="-Dcom.vaadin.testbench.screenshot.block.error=${com.vaadin.testbench.screenshot.block.error}" />
+
 
                        <jvmarg value="-Djava.awt.headless=true" />