From a5f18a266fe8e746a71cd923f61a620cff247a0e Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Thu, 3 Dec 2015 13:10:25 +0200 Subject: Check for optimizations when looking for missing updates (#18317) A recently merged patch leaves out information from hierarchyInfo for empty connectors with state changes. This must be taken into account when looking for disappeared connectors that do not cause any hierarchy change to be sent. Change-Id: I9ae7150341a83798141d0a2806ee81cafe7c2f9a --- .../tests/application/MissingHierarchyDetection.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'uitest/src') diff --git a/uitest/src/com/vaadin/tests/application/MissingHierarchyDetection.java b/uitest/src/com/vaadin/tests/application/MissingHierarchyDetection.java index 3f55e7bd60..508ac818f6 100644 --- a/uitest/src/com/vaadin/tests/application/MissingHierarchyDetection.java +++ b/uitest/src/com/vaadin/tests/application/MissingHierarchyDetection.java @@ -27,7 +27,10 @@ import com.vaadin.ui.SelectiveRenderer; public class MissingHierarchyDetection extends AbstractTestUI { private boolean isChildRendered = true; - private BrokenCssLayout layout = new BrokenCssLayout(); + private BrokenCssLayout brokenLayout = new BrokenCssLayout(); + + private CssLayout normalLayout = new CssLayout(new Label( + "Normal layout child")); public class BrokenCssLayout extends CssLayout implements SelectiveRenderer { public BrokenCssLayout() { @@ -45,7 +48,8 @@ public class MissingHierarchyDetection extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - addComponent(layout); + addComponent(brokenLayout); + addComponent(normalLayout); addComponent(new Button("Toggle properly", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { @@ -64,7 +68,12 @@ public class MissingHierarchyDetection extends AbstractTestUI { private void toggle(boolean properly) { isChildRendered = !isChildRendered; if (properly) { - layout.markAsDirtyRecursive(); + brokenLayout.markAsDirtyRecursive(); } + + normalLayout.getComponent(0).setVisible(isChildRendered); + // Must also have a state change of the layout to trigger special case + // related to optimizations + normalLayout.setCaption("With child: " + isChildRendered); } } -- cgit v1.2.3