diff options
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/AbstractTestUI.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/AbstractTestUI.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/AbstractTestUI.java b/uitest/src/com/vaadin/tests/components/AbstractTestUI.java index dba055a65a..98b0f63ce1 100644 --- a/uitest/src/com/vaadin/tests/components/AbstractTestUI.java +++ b/uitest/src/com/vaadin/tests/components/AbstractTestUI.java @@ -205,4 +205,18 @@ public abstract class AbstractTestUI extends UI { return getSession().getBrowser(); } + /** + * Execute the provided runnable on the UI thread as soon as the current + * request has been sent. + */ + protected void runAfterResponse(final Runnable runnable) { + // Immediately start a thread that will start waiting for the session to + // get unlocked. + new Thread() { + @Override + public void run() { + accessSynchronously(runnable); + } + }.start(); + } } |