summaryrefslogtreecommitdiffstats
path: root/uitest/src/test
diff options
context:
space:
mode:
authorArtur <artur@vaadin.com>2017-08-01 10:56:41 +0300
committerHenri Sara <henri.sara@gmail.com>2017-08-01 10:56:41 +0300
commit3766ab61c90885c8657186c4b033667dc2fa25db (patch)
treef0f05b7fbc55d49fff9bb00eceba0e48adef74da /uitest/src/test
parent0b28903d785ad7a44e9796823d82302cf44c064b (diff)
downloadvaadin-framework-3766ab61c90885c8657186c4b033667dc2fa25db.tar.gz
vaadin-framework-3766ab61c90885c8657186c4b033667dc2fa25db.zip
Do full connector tracker cleanup when the session lock is released (#9707) (#9730)
As there is no "request end" call after invoking UI.access() from a background thread, the connector map was not earlier properly cleaned afterwards. If you toggled visibility of a component from the background thread, the tracker state became inconsistent. If this becomes a performance problem, it could probably be optimized to that cleanup is done in request end and only at the end of access if not inside a request. Backported from master Fixes #9693
Diffstat (limited to 'uitest/src/test')
-rw-r--r--uitest/src/test/java/com/vaadin/tests/push/PushToggleComponentVisibilityTest.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/push/PushToggleComponentVisibilityTest.java b/uitest/src/test/java/com/vaadin/tests/push/PushToggleComponentVisibilityTest.java
new file mode 100644
index 0000000000..011fa55e83
--- /dev/null
+++ b/uitest/src/test/java/com/vaadin/tests/push/PushToggleComponentVisibilityTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2000-2016 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.push;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.support.ui.ExpectedCondition;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.LabelElement;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class PushToggleComponentVisibilityTest extends SingleBrowserTest {
+
+ private static final String HIDE = "hide";
+
+ @Test
+ public void ensureComponentVisible() {
+ openTestURL();
+
+ $(ButtonElement.class).id(HIDE).click();
+ Assert.assertEquals("Please wait",
+ $(LabelElement.class).first().getText());
+
+ waitUntil(new ExpectedCondition<Object>() {
+ @Override
+ public Object apply(WebDriver driver) {
+ return isElementPresent(ButtonElement.class);
+ }
+ });
+ $(ButtonElement.class).id(HIDE).click();
+ Assert.assertEquals("Please wait",
+ $(LabelElement.class).first().getText());
+ }
+}