Fix evaluation tests - create views in gui thread

This commit is contained in:
Nikolay Krasko
2015-12-30 16:43:08 +03:00
parent 139964bf31
commit 4dffacfd1b
@@ -29,6 +29,8 @@ import com.intellij.debugger.settings.NodeRendererSettings
import com.intellij.debugger.ui.impl.watch.* import com.intellij.debugger.ui.impl.watch.*
import com.intellij.debugger.ui.tree.* import com.intellij.debugger.ui.tree.*
import com.intellij.execution.process.ProcessOutputTypes import com.intellij.execution.process.ProcessOutputTypes
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.ModalityState
import com.intellij.openapi.util.Disposer import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.io.FileUtil import com.intellij.openapi.util.io.FileUtil
import com.intellij.psi.PsiElement import com.intellij.psi.PsiElement
@@ -122,8 +124,13 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() {
doStepping(path) doStepping(path)
val variablesView = createVariablesView() var variablesView: XVariablesView? = null
val watchesView = createWatchesView() var watchesView: XWatchesViewImpl? = null
ApplicationManager.getApplication().invokeAndWait({
variablesView = createVariablesView()
watchesView = createWatchesView()
}, ModalityState.any())
doOnBreakpoint { doOnBreakpoint {
val exceptions = linkedMapOf<String, Throwable>() val exceptions = linkedMapOf<String, Throwable>()
@@ -142,7 +149,7 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() {
} }
finally { finally {
if (shouldPrintFrame) { if (shouldPrintFrame) {
printFrame(variablesView, watchesView, PrinterConfig(skipInPrintFrame, descriptorViewOptions)) printFrame(variablesView!!, watchesView!!, PrinterConfig(skipInPrintFrame, descriptorViewOptions))
println(fileText, ProcessOutputTypes.SYSTEM) println(fileText, ProcessOutputTypes.SYSTEM)
} }
else { else {
@@ -152,6 +159,7 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() {
checkExceptions(exceptions) checkExceptions(exceptions)
} }
finish() finish()
} }