diff options
author | Leif Åstrand <leif@vaadin.com> | 2015-01-09 18:34:28 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-01-15 14:26:04 +0000 |
commit | 74aa5c73811658782624b1cb761533ae2e8040d8 (patch) | |
tree | 39774c9c103a1435f07e68aff9fc88f117e1a96b /uitest/src/com/vaadin/tests/layoutmanager | |
parent | a5d8097f03bb99b585ec93acc99bc5cb4c7108af (diff) | |
download | vaadin-framework-74aa5c73811658782624b1cb761533ae2e8040d8.tar.gz vaadin-framework-74aa5c73811658782624b1cb761533ae2e8040d8.zip |
Disallow layoutNow() while updating the state (#13611)
Change-Id: Ic519cbfb6507566a46d0313455695c4a40de55b8
Diffstat (limited to 'uitest/src/com/vaadin/tests/layoutmanager')
-rw-r--r-- | uitest/src/com/vaadin/tests/layoutmanager/LayoutDuringStateUpdate.java | 32 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/layoutmanager/LayoutDuringStateUpdateTest.java | 36 |
2 files changed, 68 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/layoutmanager/LayoutDuringStateUpdate.java b/uitest/src/com/vaadin/tests/layoutmanager/LayoutDuringStateUpdate.java new file mode 100644 index 0000000000..cfebfef004 --- /dev/null +++ b/uitest/src/com/vaadin/tests/layoutmanager/LayoutDuringStateUpdate.java @@ -0,0 +1,32 @@ +/* + * Copyright 2000-2014 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.layoutmanager; + +import com.vaadin.annotations.Widgetset; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.tests.widgetset.TestingWidgetSet; +import com.vaadin.tests.widgetset.server.LayoutDuringStateUpdateComponent; + +@Widgetset(TestingWidgetSet.NAME) +public class LayoutDuringStateUpdate extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + addComponent(new LayoutDuringStateUpdateComponent()); + } + +} diff --git a/uitest/src/com/vaadin/tests/layoutmanager/LayoutDuringStateUpdateTest.java b/uitest/src/com/vaadin/tests/layoutmanager/LayoutDuringStateUpdateTest.java new file mode 100644 index 0000000000..8c71d460bb --- /dev/null +++ b/uitest/src/com/vaadin/tests/layoutmanager/LayoutDuringStateUpdateTest.java @@ -0,0 +1,36 @@ +/* + * Copyright 2000-2014 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.layoutmanager; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.SingleBrowserTest; + +public class LayoutDuringStateUpdateTest extends SingleBrowserTest { + + @Test + public void layoutDuringStateUpdate() { + openTestURL(); + + WebElement label = findElement(By.className("gwt-Label")); + + Assert.assertEquals("Layout phase count: 1", label.getText()); + } + +} |