Skip to content

Ghidra is a software reverse engineering (SRE) framework

Tests - fixed ToolActionsManagerTest

dragonmacher8eef7ddc0a25
diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/ToolManagerImpl.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/ToolManagerImpl.java
index e2d6e41ce5..e3ad13d89c 100644
--- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/ToolManagerImpl.java
+++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/ToolManagerImpl.java
@@ -70,9 +70,6 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
private Map<String, ToolSaveStatus> toolStatusMap = new HashMap<>();
- /**
- * creates a tool manager for the project
- */
public ToolManagerImpl(Project project) {
this.project = project;
this.toolChest = project.getLocalToolChest();
@@ -91,8 +88,7 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
* Registers the new instance of the tool in the namesMap and returns the total number of
* running instances of that tool
* @param toolName the name of the tool being registers
- * @param tool the tool being registered.
- * @return the total number of running instances of the tool
+ * @param tool the tool being registered
*/
private void registerTool(String toolName, Tool tool) {
List<Tool> list = namesMap.get(toolName);
@@ -124,17 +120,11 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
tool.removePropertyChangeListener(this);
}
- /*
- * @see ghidra.framework.model.ToolManager#getActiveWorkspace()
- */
@Override
public Workspace getActiveWorkspace() {
return activeWorkspace;
}
- /*
- * @see ghidra.framework.model.ToolManager#getConsumerTools()
- */
@Override
public Tool[] getConsumerTools() {
ArrayList<Tool> consumers = new ArrayList<>(TYPICAL_NUM_TOOLS);
@@ -149,9 +139,6 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
return tools;
}
- /*
- * @see ghidra.framework.model.ToolManager#getProducerTools()
- */
@Override
public Tool[] getProducerTools() {
ArrayList<Tool> producers = new ArrayList<>(TYPICAL_NUM_TOOLS);
@@ -165,9 +152,6 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
return producers.toArray(tools);
}
- /*
- * @see ghidra.framework.model.ToolManager#getRunningTools()
- */
@Override
public Tool[] getRunningTools() {
Workspace[] wsList = new Workspace[workspaces.size()];
@@ -200,9 +184,6 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
return tc;
}
- /*
- * @see ghidra.framework.model.ToolManager#createWorkspace(java.lang.String)
- */
@Override
public Workspace createWorkspace(String name) throws DuplicateNameException {
// if passed in the default "untitled" name, or no name at all,
@@ -291,9 +272,6 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
}
}
- /*
- * @see ghidra.framework.model.ToolManager#getWorkspaces()
- */
@Override
public Workspace[] getWorkspaces() {
Workspace[] wsList = new Workspace[workspaces.size()];
@@ -301,7 +279,8 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
}
/**
- * saves this object to an XML element.
+ * Saves this object to an XML element
+ * @return the element containing the tool XML
*/
public Element saveToXml() {
@@ -378,6 +357,7 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
/**
* Return whether any tools have changed, or if any tools were
* added or removed from any of the workspaces.
+ * @return true if any tools in this workspace have changed
*/
public boolean hasChanged() {
// check the connections for changes
@@ -407,7 +387,8 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
/**
* Save the tools that are opened and changed, that will be brought back up when the project
- * is reopened.
+ * is reopened
+ * @return true if the session was saved
*/
public boolean saveSessionTools() {
Set<String> keySet = namesMap.keySet();
@@ -483,9 +464,6 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
}
}
- /*
- * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
- */
@Override
public void propertyChange(PropertyChangeEvent evt) {
@@ -514,17 +492,11 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
firePropertyChangeEvent(evt);
}
- /*
- * @see ghidra.framework.model.ToolManager#addWorkspaceChangeListener(ghidra.framework.model.WorkspaceChangeListener)
- */
@Override
public void addWorkspaceChangeListener(WorkspaceChangeListener l) {
changeListeners.add(l);
}
- /*
- * @see ghidra.framework.model.ToolManager#removeWorkspaceChangeListener(ghidra.framework.model.WorkspaceChangeListener)
- */
@Override
public void removeWorkspaceChangeListener(WorkspaceChangeListener l) {
changeListeners.remove(l);
@@ -543,7 +515,7 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
}
/**
- * Get any toolservices available from this tool.
+ * Get any tool services available from this tool
*
* @return ToolServices list of tool services this tool can provide.
*/
@@ -551,10 +523,6 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
return toolServices;
}
- /*
- * (non-Javadoc)
- * @see ghidra.framework.model.ToolManager#toolChanged(ghidra.framework.model.Tool)
- */
@Override
public void toolChanged(Tool tool) {
updateConnectMap(tool);
@@ -565,6 +533,8 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
// restoring the front end tool.
/**
* Called by WorkspaceImpl when it is restoring its state.
+ * @param toolName the name of the tool
+ * @return the tool
*/
public Tool getTool(String toolName) {
ToolTemplate template = toolServices.getToolChest().getToolTemplate(toolName);
@@ -663,7 +633,7 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
* @param ws workspace to rename
* @param name new name of workspace
*
- * @throws DuplicateNameException
+ * @throws DuplicateNameException if there already exists a workspace by the given name
*/
void setWorkspaceName(Workspace ws, String name) throws DuplicateNameException {
@@ -682,7 +652,7 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
}
}
- /**
+ /*
* Get a tool from the template; set the instance name.
*/
Tool getTool(Workspace ws, ToolTemplate template) {
@@ -693,7 +663,7 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
return tool;
}
- /**
+ /*
* Called by the workspace when a tool is removed.
*/
void toolRemoved(Workspace ws, Tool tool) {
@@ -743,14 +713,10 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
}
catch (PropertyVetoException e) {
// shouldn't happen
- Msg.showError(this, null, "Error", "set type name was vetoed", e);
+ Msg.showError(this, null, "Error Setting Tool Name", "Set tool name was vetoed", e);
}
- Msg.debug(this, "Loaded " + tool.getName());
}
- /**
- * Called when a tool is added.
- */
void fireToolAddedEvent(Workspace ws, Tool tool) {
for (int i = 0; i < changeListeners.size(); i++) {
WorkspaceChangeListener l = changeListeners.get(i);
@@ -758,10 +724,6 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
}
}
- /**
- * Remove all connection objects for the given tool.
- * @param tool
- */
@Override
public void disconnectTool(Tool tool) {
Iterator<String> keys = connectMap.keySet().iterator();
@@ -777,10 +739,6 @@ public class ToolManagerImpl implements ToolManager, PropertyChangeListener {
}
}
- /**
- * Update the connection map for the given tool.
- * @param tool
- */
private void updateConnectMap(Tool tool) {
Iterator<String> keys = connectMap.keySet().iterator();
Map<String, ToolConnectionImpl> map = new HashMap<>();
diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/ToolServicesImpl.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/ToolServicesImpl.java
index 6a0dd00348..3ef14dc5ed 100644
--- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/ToolServicesImpl.java
+++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/ToolServicesImpl.java
@@ -102,9 +102,10 @@ class ToolServicesImpl implements ToolServices {
if (!exportFile.getName().endsWith(ToolUtils.TOOL_EXTENSION)) {
exportFile = new File(exportFile.getAbsolutePath() + ToolUtils.TOOL_EXTENSION);
}
+
if (exportFile.exists()) {
int result = OptionDialog.showOptionDialog(null, "Overwrite?",
- "Overwrite existing file, " + exportFile.getName() + "?", "Overwrite",
+ "Overwrite existing file: '" + exportFile.getName() + "'?", "Overwrite",
OptionDialog.QUESTION_MESSAGE);
if (result != OptionDialog.OPTION_ONE) {
exportFile = null; // user chose not to overwrite
diff --git a/Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/framework/main/ToolActionManagerTest.java b/Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/framework/main/ToolActionManagerTest.java
index cae30ebb12..4d25850260 100644
--- a/Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/framework/main/ToolActionManagerTest.java
+++ b/Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/framework/main/ToolActionManagerTest.java
@@ -61,6 +61,7 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
private FrontEndTool frontEndTool;
private TestEnv env;
+ private File exportFile = new File(GenericRunInfo.getProjectsDirPath(), "untitled.tool");
@Before
public void setUp() throws Exception {
@@ -69,6 +70,8 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
frontEndTool = env.getFrontEndTool();
env.showFrontEndTool();
+
+ exportFile.delete();
}
@After
@@ -180,14 +183,9 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
DockingActionIf importAction = getAction("Import Tool");
performAction(importAction, false);
- waitForSwing();
- JDialog d = waitForJDialog("Import Tool");
- assertNotNull(d);
- final GhidraFileChooser chooser = waitForDialogComponent(GhidraFileChooser.class);
+ GhidraFileChooser chooser = waitForDialogComponent(GhidraFileChooser.class);
- assertNotNull(chooser);
- SwingUtilities.invokeAndWait(() -> chooser.setSelectedFile(cbFile));
- waitForUpdateOnChooser(chooser);
+ setSelectedFile(chooser, cbFile);
pressButtonByText(chooser, "Import");
waitForSwing();
@@ -202,13 +200,7 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
}
assertTrue(list.size() > 0);
Collections.sort(list);
- SwingUtilities.invokeAndWait(() -> tc.remove(list.get(list.size() - 1)));
- }
-
- private Program buildProgram(String programName) throws Exception {
- ProgramBuilder builder = new ProgramBuilder(programName, ProgramBuilder._TOY);
- builder.createMemory("test1", Long.toHexString(0x1001000), 0x2000);
- return builder.getProgram();
+ runSwing(() -> tc.remove(list.get(list.size() - 1)));
}
@Test
@@ -395,58 +387,6 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
waitForSwing();
}
- private void close(final Tool tool) {
- runSwing(() -> tool.close());
- }
-
- private void removePreferences() {
- Preferences.clear();
- }
-
- private Tool waitForTool(String toolName, Project project) {
- Tool tool = null;
- int sleepTime = 100;
- int waitCount = 0;
- while (tool == null && waitCount < 300) {
- waitForSwing();
- sleep(sleepTime);
- ToolManager toolManager = project.getToolManager();
- Tool[] runningTools = toolManager.getRunningTools();
- if (runningTools != null && runningTools.length > 0) {
- tool = runningTools[0];
- }
- }
-
- assertNotNull("Did not find a single running " + toolName + " tool", tool);
- assertEquals("Running tool is not " + toolName, toolName, tool.getName());
-
- return tool;
- }
-
- private void initializeToolChestToJustCodeBrowser() {
- final ToolServices toolServices = frontEndTool.getToolServices();
- final ToolChest toolChest = toolServices.getToolChest();
-
- final AtomicReference<String> failedTool = new AtomicReference<>();
- runSwing(() -> {
- ToolTemplate[] toolTemplates = toolChest.getToolTemplates();
- for (ToolTemplate toolTemplate : toolTemplates) {
- String name = toolTemplate.getName();
- if (!name.equals("CodeBrowser")) {
- if (!toolChest.remove(name)) {
- failedTool.set(name);
- return;
- }
- }
- }
-
- });
-
- String toolName = failedTool.get();
- assertNull("Failed to remove tool: " + toolName, toolName);
- assertEquals("Did not remove tools as expected", 1, toolChest.getToolCount());
- }
-
@Test
public void testImportDefaultTools() throws Exception {
final ToolChest tc = frontEndTool.getToolServices().getToolChest();
@@ -493,7 +433,7 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
newList.add(config.getName());
}
newList.removeAll(origList);
- SwingUtilities.invokeAndWait(() -> {
+ runSwing(() -> {
for (int i = 0; i < newList.size(); i++) {
tc.remove(newList.get(i));
}
@@ -544,22 +484,13 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
DockingActionIf exportAction = getAction("Untitled", "Export Tool");
performAction(exportAction, "Untitled", false);
+ GhidraFileChooser chooser = waitForDialogComponent(GhidraFileChooser.class);
- waitForSwing();
- JDialog d = waitForJDialog("Export Untitled");
- assertNotNull(d);
- final GhidraFileChooser chooser = waitForDialogComponent(GhidraFileChooser.class);
-
- assertNotNull(chooser);
- final File file = new File(GenericRunInfo.getProjectsDirPath(), "untitled.tool");
-
- SwingUtilities.invokeAndWait(() -> chooser.setSelectedFile(file));
- waitForUpdateOnChooser(chooser);
+ setSelectedFile(chooser, exportFile);
pressButtonByText(chooser, "Export");
waitForSwing();
- assertTrue(file.exists());
- file.delete();
+ assertTrue(exportFile.exists());
}
@Test
@@ -569,39 +500,25 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
DockingActionIf exportAction = getAction("Untitled", "Export Tool");
performAction(exportAction, "Untitled", false);
+ GhidraFileChooser chooser = waitForDialogComponent(GhidraFileChooser.class);
- waitForSwing();
- JDialog d = waitForJDialog("Export Untitled");
- assertNotNull(d);
- final GhidraFileChooser chooser = waitForDialogComponent(GhidraFileChooser.class);
- assertNotNull(chooser);
- final File file = new File(GenericRunInfo.getProjectsDirPath(), "untitled.tool");
-
- SwingUtilities.invokeAndWait(() -> chooser.setSelectedFile(file));
- waitForUpdateOnChooser(chooser);
+ setSelectedFile(chooser, exportFile);
pressButtonByText(chooser, "Export");
waitForSwing();
performAction(exportAction, "Untitled", false);
+ chooser = waitForDialogComponent(GhidraFileChooser.class);
- waitForSwing();
- d = waitForJDialog("Export Untitled");
- assertNotNull(d);
-
- SwingUtilities.invokeAndWait(() -> chooser.setSelectedFile(file));
- waitForUpdateOnChooser(chooser);
- final JButton b = findButtonByText(chooser, "Export");
- SwingUtilities.invokeLater(() -> b.getActionListeners()[0].actionPerformed(null));
- waitForSwing();
+ setSelectedFile(chooser, exportFile);
+ JButton b = findButtonByText(chooser, "Export");
+ pressButton(b, false);
OptionDialog optD = waitForDialogComponent(OptionDialog.class);
assertNotNull(optD);
assertEquals("Overwrite?", optD.getTitle());
- pressButtonByText(optD.getComponent(), "Yes");
+ pressButtonByText(optD.getComponent(), "Overwrite");
waitForSwing();
- assertTrue(file.exists());
-
- file.delete();
+ assertTrue(exportFile.exists());
}
@Test
@@ -611,42 +528,28 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
DockingActionIf exportAction = getAction("Untitled", "Export Tool");
performAction(exportAction, "Untitled", false);
+ GhidraFileChooser chooser = waitForDialogComponent(GhidraFileChooser.class);
- waitForSwing();
- JDialog d = waitForJDialog("Export Untitled");
- assertNotNull(d);
- final GhidraFileChooser chooser = waitForDialogComponent(GhidraFileChooser.class);
- assertNotNull(chooser);
- final File file = new File(GenericRunInfo.getProjectsDirPath(), "untitled.tool");
-
- SwingUtilities.invokeAndWait(() -> chooser.setSelectedFile(file));
- waitForUpdateOnChooser(chooser);
+ setSelectedFile(chooser, exportFile);
pressButtonByText(chooser, "Export");
waitForSwing();
performAction(exportAction, "Untitled", false);
- waitForSwing();
- d = waitForJDialog("Export Untitled");
- assertNotNull(d);
+ chooser = waitForDialogComponent(GhidraFileChooser.class);
+ setSelectedFile(chooser, exportFile);
- SwingUtilities.invokeAndWait(() -> chooser.setSelectedFile(file));
- waitForUpdateOnChooser(chooser);
- final JButton b = findButtonByText(chooser, "Export");
- SwingUtilities.invokeLater(() -> b.getActionListeners()[0].actionPerformed(null));
+ JButton b = findButtonByText(chooser, "Export");
+ pressButton(b, false);
waitForSwing();
+
OptionDialog optD = waitForDialogComponent(OptionDialog.class);
assertNotNull(optD);
assertEquals("Overwrite?", optD.getTitle());
- pressButtonByText(optD.getComponent(), "No");
- waitForSwing();
- d = waitForJDialog("Export Untitled");
- final GhidraFileChooser ch = waitForDialogComponent(GhidraFileChooser.class);
- assertNotNull(ch);
- pressButtonByText(ch, "Cancel");
- assertTrue(!d.isVisible());
- file.delete();
+ pressButtonByText(optD.getComponent(), "Cancel");
+ chooser = waitForDialogComponent(GhidraFileChooser.class);
+ pressButtonByText(chooser, "Cancel");
}
@Test
@@ -656,37 +559,24 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
DockingActionIf exportAction = getAction("Untitled", "Export Tool");
performAction(exportAction, "Untitled", false);
+ GhidraFileChooser chooser = waitForDialogComponent(GhidraFileChooser.class);
- waitForSwing();
- JDialog d = waitForJDialog("Export Untitled");
- assertNotNull(d);
- final GhidraFileChooser chooser = waitForDialogComponent(GhidraFileChooser.class);
- assertNotNull(chooser);
- final File file = new File(GenericRunInfo.getProjectsDirPath(), "untitled.tool");
-
- SwingUtilities.invokeAndWait(() -> chooser.setSelectedFile(file));
- waitForUpdateOnChooser(chooser);
+ setSelectedFile(chooser, exportFile);
pressButtonByText(chooser, "Export");
waitForSwing();
performAction(exportAction, "Untitled", false);
- waitForSwing();
- d = waitForJDialog("Export Untitled");
- assertNotNull(d);
+ chooser = waitForDialogComponent(GhidraFileChooser.class);
+ setSelectedFile(chooser, exportFile);
- SwingUtilities.invokeAndWait(() -> chooser.setSelectedFile(file));
- waitForUpdateOnChooser(chooser);
- final JButton b = findButtonByText(chooser, "Export");
- SwingUtilities.invokeLater(() -> b.getActionListeners()[0].actionPerformed(null));
- waitForSwing();
+ JButton b = findButtonByText(chooser, "Export");
+ pressButton(b, false);
OptionDialog optD = waitForDialogComponent(OptionDialog.class);
assertNotNull(optD);
assertEquals("Overwrite?", optD.getTitle());
pressButtonByText(optD.getComponent(), "Cancel");
-
- file.delete();
}
@Test
@@ -695,19 +585,12 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
DockingActionIf exportAction = getAction("Export Tool");
performToolButtonAction(exportAction, "Untitled", false, false);
- waitForSwing();
- JDialog d = waitForJDialog("Export Untitled");
- assertNotNull(d);
- final GhidraFileChooser chooser = waitForDialogComponent(GhidraFileChooser.class);
- assertNotNull(chooser);
- final File file = new File(GenericRunInfo.getProjectsDirPath(), "untitled.tool");
+ GhidraFileChooser chooser = waitForDialogComponent(GhidraFileChooser.class);
+ setSelectedFile(chooser, exportFile);
- SwingUtilities.invokeAndWait(() -> chooser.setSelectedFile(file));
- waitForUpdateOnChooser(chooser);
pressButtonByText(chooser, "Export");
waitForSwing();
- assertTrue(file.exists());
- file.delete();
+ assertTrue(exportFile.exists());
}
@Test
@@ -721,6 +604,69 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
assertEquals(0, frontEndTool.getToolServices().getRunningTools().length);
}
+ private Program buildProgram(String programName) throws Exception {
+ ProgramBuilder builder = new ProgramBuilder(programName, ProgramBuilder._TOY);
+ builder.createMemory("test1", Long.toHexString(0x1001000), 0x2000);
+ return builder.getProgram();
+ }
+
+ private void close(final Tool tool) {
+ runSwing(() -> tool.close());
+ }
+
+ private void removePreferences() {
+ Preferences.clear();
+ }
+
+ private Tool waitForTool(String toolName, Project project) {
+ Tool tool = null;
+ int sleepTime = 100;
+ int waitCount = 0;
+ while (tool == null && waitCount < 300) {
+ waitForSwing();
+ sleep(sleepTime);
+ ToolManager toolManager = project.getToolManager();
+ Tool[] runningTools = toolManager.getRunningTools();
+ if (runningTools != null && runningTools.length > 0) {
+ tool = runningTools[0];
+ }
+ }
+
+ assertNotNull("Did not find a single running " + toolName + " tool", tool);
+ assertEquals("Running tool is not " + toolName, toolName, tool.getName());
+
+ return tool;
+ }
+
+ private void initializeToolChestToJustCodeBrowser() {
+ final ToolServices toolServices = frontEndTool.getToolServices();
+ final ToolChest toolChest = toolServices.getToolChest();
+
+ final AtomicReference<String> failedTool = new AtomicReference<>();
+ runSwing(() -> {
+ ToolTemplate[] toolTemplates = toolChest.getToolTemplates();
+ for (ToolTemplate toolTemplate : toolTemplates) {
+ String name = toolTemplate.getName();
+ if (!name.equals("CodeBrowser")) {
+ if (!toolChest.remove(name)) {
+ failedTool.set(name);
+ return;
+ }
+ }
+ }
+
+ });
+
+ String toolName = failedTool.get();
+ assertNull("Failed to remove tool: " + toolName, toolName);
+ assertEquals("Did not remove tools as expected", 1, toolChest.getToolCount());
+ }
+
+ private void setSelectedFile(GhidraFileChooser chooser, File f) throws Exception {
+ runSwing(() -> chooser.setSelectedFile(f));
+ waitForUpdateOnChooser(chooser);
+ }
+
private DockingActionIf getAction(String toolName, String action) {
Set<DockingActionIf> actions =
getActionsByOwnerAndName(frontEndTool, "FrontEndPlugin", toolName);
@@ -770,10 +716,10 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
final ToolButton tb = findToolButton(frontEndTool.getToolFrame(), name, runningTool);
Runnable r = () -> action.actionPerformed(new ActionContext(null, tb, tb));
if (doWait) {
- SwingUtilities.invokeAndWait(r);
+ runSwing(r);
}
else {
- SwingUtilities.invokeLater(r);
+ runSwing(r, false);
}
waitForSwing();
}