From 2db23a9a902b7be1257df55d254a68438a678d3c Mon Sep 17 00:00:00 2001
From: buczekp <buczekp>
Date: Wed, 7 Jul 2010 16:46:44 +0000
Subject: [PATCH] [LMS-1625] partly fixed experiment viewer tests - execute
 deferred actions immediately in testing mode

SVN: 16928
---
 .../client/web/client/application/util/GWTUtils.java | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/GWTUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/GWTUtils.java
index 7f096cfc45e..6cac23901f6 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/GWTUtils.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/GWTUtils.java
@@ -118,11 +118,19 @@ public final class GWTUtils
     }
 
     /**
-     * Deferrs a task allowing browser to handle events.
+     * Defers a task allowing browser to handle events.
      */
     public static void executeDelayed(final IDelegatedAction delegatedAction)
     {
-        DeferredCommand.addCommand(delegatedAction);
+        // In testing mode the action has to be performed without delay - otherwise system tests
+        // will perform new commands before the deferred action starts.
+        if (isTesting() == false)
+        {
+            DeferredCommand.addCommand(delegatedAction);
+        } else
+        {
+            delegatedAction.execute();
+        }
     }
 
     /**
-- 
GitLab