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.tree.*
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.io.FileUtil
import com.intellij.psi.PsiElement
@@ -122,8 +124,13 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() {
doStepping(path)
val variablesView = createVariablesView()
val watchesView = createWatchesView()
var variablesView: XVariablesView? = null
var watchesView: XWatchesViewImpl? = null
ApplicationManager.getApplication().invokeAndWait({
variablesView = createVariablesView()
watchesView = createWatchesView()
}, ModalityState.any())
doOnBreakpoint {
val exceptions = linkedMapOf<String, Throwable>()
@@ -142,7 +149,7 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() {
}
finally {
if (shouldPrintFrame) {
printFrame(variablesView, watchesView, PrinterConfig(skipInPrintFrame, descriptorViewOptions))
printFrame(variablesView!!, watchesView!!, PrinterConfig(skipInPrintFrame, descriptorViewOptions))
println(fileText, ProcessOutputTypes.SYSTEM)
}
else {
@@ -152,6 +159,7 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() {
checkExceptions(exceptions)
}
finish()
}