aboutsummaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorAnastasia Smirnova <anasmi@utu.fi>2018-05-03 13:07:29 +0300
committerIlia Motornyi <elmot@vaadin.com>2018-05-03 13:07:29 +0300
commitd65325e326f40e6e9abd3b7f62493e3314e788b5 (patch)
tree8a46ace98f3a1f7ce6290f98a3e7d2085830c62e /uitest
parent1d6002baf96ec0cc4cb6aff7336af8fa94f57c63 (diff)
downloadvaadin-framework-d65325e326f40e6e9abd3b7f62493e3314e788b5.tar.gz
vaadin-framework-d65325e326f40e6e9abd3b7f62493e3314e788b5.zip
Allow focus to another component, when closing the window (#10860)
Resolves #5891
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/FocusOutsideWindow.java5
-rw-r--r--uitest/src/test/java/com/vaadin/tests/FocusOutsideWindowTest.java1
2 files changed, 5 insertions, 1 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/FocusOutsideWindow.java b/uitest/src/main/java/com/vaadin/tests/FocusOutsideWindow.java
index d86c25a171..26fe97f2bd 100644
--- a/uitest/src/main/java/com/vaadin/tests/FocusOutsideWindow.java
+++ b/uitest/src/main/java/com/vaadin/tests/FocusOutsideWindow.java
@@ -1,11 +1,14 @@
package com.vaadin.tests;
+import com.vaadin.annotations.Widgetset;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Label;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Window;
+@Widgetset("com.vaadin.DefaultWidgetSet")
public class FocusOutsideWindow extends AbstractTestUI {
private boolean focusTextF = true;
@@ -23,8 +26,8 @@ public class FocusOutsideWindow extends AbstractTestUI {
button.addClickListener(new Button.ClickListener() {
public void buttonClick(Button.ClickEvent event) {
Window window = new Window("WINDOW");
+ window.setContent(new Label("Inside window"));
window.setHeight("100px");
- // window.setModal(true);
window.addCloseListener(new Window.CloseListener() {
@Override
public void windowClose(Window.CloseEvent e) {
diff --git a/uitest/src/test/java/com/vaadin/tests/FocusOutsideWindowTest.java b/uitest/src/test/java/com/vaadin/tests/FocusOutsideWindowTest.java
index c87a356922..07dfffb6dc 100644
--- a/uitest/src/test/java/com/vaadin/tests/FocusOutsideWindowTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/FocusOutsideWindowTest.java
@@ -26,6 +26,7 @@ public class FocusOutsideWindowTest extends MultiBrowserTest {
focusBut.click();
openW.click();
$(WindowElement.class).first().close();
+ Thread.sleep(150);
assertEquals(openW, getFocusedElement());
}
}