Skip to content

Commit

Permalink
[ui-tests] Improve logging for screen recording
Browse files Browse the repository at this point in the history
GitOrigin-RevId: f43fe35228f3547d71aa3bdf1982cc39b83a1003
  • Loading branch information
MaXal authored and intellij-monorepo-bot committed Feb 17, 2025
1 parent c3db730 commit d60456f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.intellij.ide.starter.screenRecorder
import com.intellij.ide.starter.ide.DEFAULT_DISPLAY_ID
import com.intellij.ide.starter.ide.DEFAULT_DISPLAY_RESOLUTION
import com.intellij.ide.starter.runner.IDERunContext
import com.intellij.openapi.diagnostic.getOrLogException
import com.intellij.openapi.util.SystemInfo
import com.intellij.tools.ide.util.common.logOutput
import org.monte.media.Format
Expand Down Expand Up @@ -83,7 +84,7 @@ class IDEScreenRecorder(private val runContext: IDERunContext) {
init {
//on Linux, we run xvfb and test process is headless, so we need external tool to record screen
if (!SystemInfo.isLinux) {
javaScreenRecorder = runCatching { getScreenRecorder((runContext.logsDir / "screenRecording").toFile()) }.getOrNull()
javaScreenRecorder = runCatching { getScreenRecorder((runContext.logsDir / "screenRecording").toFile()) }.getOrLogException { logOutput("Can't create screen recorder: ${it.message}") }
}
}

Expand All @@ -109,6 +110,7 @@ class IDEScreenRecorder(private val runContext: IDERunContext) {
}

fun stop() {
if (javaScreenRecorder == null && ffmpegProcess == null) {logOutput("Screen recorder was not started")}
javaScreenRecorder?.stop()
ffmpegProcess?.destroy()
}
Expand Down

0 comments on commit d60456f

Please sign in to comment.