mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
Fixed tests failing due to focus timing issues by allowing the test
framework to specify the source of key bindings
This commit is contained in:
parent
3418492a8c
commit
3f62f91a2e
5 changed files with 71 additions and 10 deletions
|
@ -337,7 +337,7 @@ public class ComponentProviderActionsTest extends AbstractGhidraHeadedIntegratio
|
|||
// Note: there may be a test focus issue here. If this test fails sporadically due to
|
||||
// how the action context is generated (it depends on focus). It is only useful to fail
|
||||
// here in development mode.
|
||||
triggerKey(tool.getToolFrame(), controlEsc);
|
||||
triggerKey(provider.getComponent(), controlEsc);
|
||||
assertProviderIsHidden_InNonBatchMode();
|
||||
}
|
||||
|
||||
|
@ -376,6 +376,7 @@ public class ComponentProviderActionsTest extends AbstractGhidraHeadedIntegratio
|
|||
provider.addToTool();
|
||||
tool.showComponentProvider(provider, true);
|
||||
waitForSwing();
|
||||
waitForCondition(() -> provider.isVisible());
|
||||
}
|
||||
|
||||
private void hideProvider() {
|
||||
|
@ -546,6 +547,7 @@ public class ComponentProviderActionsTest extends AbstractGhidraHeadedIntegratio
|
|||
// simulate the user mousing over the toolbar button
|
||||
DockingActionIf closeAction = getAction(tool, provider.getOwner(), "Close Window");
|
||||
assertNotNull("Provider action not installed in toolbar", closeAction);
|
||||
|
||||
DockingWindowManager.setMouseOverAction(closeAction);
|
||||
|
||||
performLaunchKeyStrokeDialogAction();
|
||||
|
@ -554,6 +556,7 @@ public class ComponentProviderActionsTest extends AbstractGhidraHeadedIntegratio
|
|||
runSwing(() -> dialog.setKeyStroke(ks));
|
||||
|
||||
pressButtonByText(dialog, "OK");
|
||||
waitForSwing();
|
||||
|
||||
assertFalse("Invalid key stroke: " + ks, runSwing(() -> dialog.isVisible()));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue