summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2013-01-23 08:00:40 +0000
committerVaadin Code Review <review@vaadin.com>2013-01-23 08:00:40 +0000
commitc62a76f02d0587aa9bf6c1a95d2c308dbea0093b (patch)
tree48c56c11d4e32b247c7cdedb93004f1f64f19856 /uitest
parentbf3a8f2a7e571fdffab794ed029112561ad836f3 (diff)
parente2e2b2c1e8acc2163d117dd8193b7ecc445f4ff8 (diff)
downloadvaadin-framework-c62a76f02d0587aa9bf6c1a95d2c308dbea0093b.tar.gz
vaadin-framework-c62a76f02d0587aa9bf6c1a95d2c308dbea0093b.zip
Merge "Ensure window is closed even if close listener throws an exception (#10779)"
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.html32
-rw-r--r--uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.java35
2 files changed, 67 insertions, 0 deletions
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;
+ }
+
+}