MockApplication-based tests should fail sometimes, right?
authorGregory.Shrago <gregory.shrago@jetbrains.com>
Wed, 4 May 2016 17:41:37 +0000 (20:41 +0300)
committerGregory.Shrago <gregory.shrago@jetbrains.com>
Wed, 4 May 2016 17:41:37 +0000 (20:41 +0300)
platform/testFramework/src/com/intellij/testFramework/EdtTestUtil.kt

index 5cea358ef6cf471912b4d658294596042c001d38..6944559a04a565ece17d625d325d62002b573b42 100644 (file)
@@ -17,6 +17,7 @@ package com.intellij.testFramework
 
 import com.intellij.openapi.application.ApplicationManager
 import com.intellij.openapi.application.ModalityState
+import com.intellij.openapi.application.impl.ApplicationImpl
 import com.intellij.util.ThrowableRunnable
 import org.jetbrains.annotations.TestOnly
 import java.lang.reflect.InvocationTargetException
@@ -37,7 +38,7 @@ class EdtTestUtil {
 @TestOnly
 fun runInEdtAndWait(runnable: () -> Unit) {
   val application = ApplicationManager.getApplication()
-  if (application != null) {
+  if (application is ApplicationImpl) {
     application.invokeAndWait(runnable, ModalityState.defaultModalityState())
     return
   }