From e5b44d6d5a854cd299c447d779cff49ca3970819 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Mon, 20 May 2013 14:49:31 +0400 Subject: [PATCH] test fixed --- .../openapi/progress/impl/ProgressManagerImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/progress/impl/ProgressManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/progress/impl/ProgressManagerImpl.java index 15244ccaea18..d81e788d8ac7 100644 --- a/platform/platform-impl/src/com/intellij/openapi/progress/impl/ProgressManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/progress/impl/ProgressManagerImpl.java @@ -445,7 +445,12 @@ public class ProgressManagerImpl extends ProgressManager implements Disposable{ @Override public void run(@NotNull final Task task) { if (task.isHeadless()) { - runProcessWithProgressSynchronously(task, null); + if (ApplicationManager.getApplication().isDispatchThread()) { + runProcessWithProgressSynchronously(task, null); + } + else { + new TaskRunnable(task, new EmptyProgressIndicator()).run(); + } } else if (task.isModal()) { runProcessWithProgressSynchronously(task.asModal(), null);