Skip to content

Commit 9254b47

Browse files
committed
Add const variable for timeout
1 parent 70b5949 commit 9254b47

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ internal class InputActionsEditorTests : UIToolkitBaseTestWindow<InputActionsEdi
1616
{
1717
#region setup and teardown
1818
InputActionAsset m_Asset;
19+
const float kTimeoutSecs = 10.0f;
1920

2021
public override void OneTimeSetUp()
2122
{
@@ -126,10 +127,9 @@ public IEnumerator CanRenameActionMap()
126127
m_Window.rootVisualElement.Q<ListView>("action-maps-list-view").selectedIndex = 1;
127128

128129
// changing the selection triggers a state change, wait for the scheduler to process the frame
129-
var timeoutSecs = 10.0;
130130
yield return WaitForSchedulerLoop();
131-
yield return WaitForNotDirty(timeoutSecs);
132-
yield return WaitForFocus(m_Window.rootVisualElement.Q("action-maps-list-view"), timeoutSecs);
131+
yield return WaitForNotDirty(kTimeoutSecs);
132+
yield return WaitForFocus(m_Window.rootVisualElement.Q("action-maps-list-view"), kTimeoutSecs);
133133

134134
// refetch the action map item since the ui may have refreshed.
135135
actionMapItem = actionMapsContainer.Query<InputActionMapsTreeViewItem>().ToList();
@@ -202,18 +202,15 @@ public IEnumerator CanRenameAction()
202202
m_Window.rootVisualElement.Q<TreeView>("actions-tree-view").selectedIndex = 1;
203203

204204
// Selection change triggers a state change, wait for the scheduler to process the frame
205-
var timeoutSecs = 10.0;
206205
yield return WaitForSchedulerLoop();
207-
yield return WaitForNotDirty(timeoutSecs);
208-
yield return WaitForFocus(m_Window.rootVisualElement.Q<TreeView>("actions-tree-view"), timeoutSecs);
206+
yield return WaitForNotDirty(kTimeoutSecs);
207+
yield return WaitForFocus(m_Window.rootVisualElement.Q<TreeView>("actions-tree-view"), kTimeoutSecs);
209208

210209
// Re-fetch the actions since the UI may have refreshed.
211210
actionItem = actionContainer.Query<InputActionsTreeViewItem>().ToList();
212211

213-
// Click twice to start the rename
214212
SimulateClickOn(actionItem[1]);
215-
yield return WaitForNotDirty(timeoutSecs);
216-
213+
yield return WaitForNotDirty(kTimeoutSecs);
217214
// If the item is already focused, don't click again
218215
if (!actionItem[1].IsFocused)
219216
{

0 commit comments

Comments
 (0)