[rdct-tests] better notifications api usage

GitOrigin-RevId: 4d4c3fa7814db49c6ba8f31a67df30be64dc11e4
This commit is contained in:
Anastasia Katsman
2024-12-12 15:04:05 +01:00
committed by intellij-monorepo-bot
parent 4643e7331a
commit aac80c5a19

View File

@@ -13,7 +13,6 @@ import com.intellij.ide.impl.ProjectUtil
import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.notification.Notification
import com.intellij.notification.NotificationType
import com.intellij.notification.Notifications
import com.intellij.openapi.application.*
import com.intellij.openapi.application.impl.LaterInvocator
import com.intellij.openapi.diagnostic.Logger
@@ -511,15 +510,10 @@ open class DistributedTestHost(coroutineScope: CoroutineScope) {
}
@Suppress("HardCodedStringLiteral", "DialogTitleCapitalization")
private fun showNotification(text: String?): Notification? {
private fun showNotification(text: String?) {
if (ApplicationManager.getApplication().isHeadlessEnvironment || text.isNullOrBlank()) {
return null
return
}
val notification = Notification("TestFramework",
"Test Framework",
text,
NotificationType.INFORMATION)
Notifications.Bus.notify(notification)
return notification
Notification("TestFramework", "Test Framework", text, NotificationType.INFORMATION).notify(null)
}