[test commands] perform warmup in rename tests

- use find usages as warmup to avoid publishing fus statistics from rename refactoring during warmup stage
- use average time for search
- perform undo to ensure there is something to search for

^KTIJ-35267 fixed

GitOrigin-RevId: 1cbd6d421aaddc80a6e924c57b537dec9e98dd6d
This commit is contained in:
Anna Kozlova
2025-08-22 15:29:57 +00:00
committed by intellij-monorepo-bot
parent ee4043a727
commit b059812e82
@@ -5,6 +5,7 @@ import com.intellij.codeInsight.TargetElementUtil
import com.intellij.ide.DataManager
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.command.impl.UndoManagerImpl
import com.intellij.openapi.ui.playback.PlaybackContext
import com.intellij.openapi.ui.playback.commands.AbstractCommand
import com.intellij.openapi.wm.IdeFocusManager
@@ -30,6 +31,7 @@ class StartInlineRenameCommand(text: String, line: Int) : AbstractCommand(text,
override fun _execute(context: PlaybackContext): Promise<Any?> {
val actionCallback = ActionCallbackProfilerStopper()
val project = context.project
UndoManagerImpl.ourNeverAskUser = true
ApplicationManager.getApplication().invokeAndWait(Context.current().wrap(Runnable {
val focusedComponent = IdeFocusManager.findInstance().focusOwner
val dataContext = DataManager.getInstance().getDataContext(focusedComponent)