summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/src/com/vaadin/ui/UI.java2
-rw-r--r--uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.html32
-rw-r--r--uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.java35
3 files changed, 68 insertions, 1 deletions
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java
index 1babc077b8..7e54aa01a0 100644
--- a/server/src/com/vaadin/ui/UI.java
+++ b/server/src/com/vaadin/ui/UI.java
@@ -428,8 +428,8 @@ public abstract class UI extends AbstractSingleComponentContainer implements
return false;
}
window.setParent(null);
- window.fireClose();
markAsDirty();
+ window.fireClose();
return true;
}
diff --git a/uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.html b/uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.html
new file mode 100644
index 0000000000..923276b613
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.html
@@ -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="http://localhost:8888/" />
+<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.window.WindowWithInvalidCloseListener?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentswindowWindowWithInvalidCloseListener::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td>
+ <td>6,7</td>
+</tr>
+<tr>
+ <td>assertElementNotPresent</td>
+ <td>vaadin=runcomvaadintestscomponentswindowWindowWithInvalidCloseListener::/VWindow[0]</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.java b/uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.java
new file mode 100644
index 0000000000..991b5626eb
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.java
@@ -0,0 +1,35 @@
+package com.vaadin.tests.components.window;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Window;
+import com.vaadin.ui.Window.CloseEvent;
+import com.vaadin.ui.Window.CloseListener;
+
+public class WindowWithInvalidCloseListener extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Window w = new Window("Close me");
+ w.addCloseListener(new CloseListener() {
+
+ @Override
+ public void windowClose(CloseEvent e) {
+ throw new RuntimeException(
+ "Close listener intentionally failed");
+ }
+ });
+ addWindow(w);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "The window has a close listener which throws an exception. This should not prevent the window from being closed.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 10779;
+ }
+
+}