mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 12:00:04 +02:00
Test fixes for Swing access from a script thread
This commit is contained in:
parent
5e0c5ee3fc
commit
1623f0a069
2 changed files with 12 additions and 16 deletions
|
@ -36,6 +36,7 @@ import ghidra.framework.model.DomainObjectListener;
|
|||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.Swing;
|
||||
import ghidra.util.table.GhidraProgramTableModel;
|
||||
import ghidra.util.table.actions.DeleteTableRowAction;
|
||||
import ghidra.util.task.SwingUpdateManager;
|
||||
|
@ -265,16 +266,13 @@ public class TableServicePlugin extends ProgramPlugin
|
|||
navigatable = gotoService.getDefaultNavigatable();
|
||||
}
|
||||
|
||||
TableChooserDialog dialog =
|
||||
new MyTableChooserDialog(this, executor, program, title, navigatable, isModal);
|
||||
Navigatable nav = navigatable;
|
||||
TableChooserDialog dialog = Swing.runNow(
|
||||
() -> new MyTableChooserDialog(this, executor, program, title, nav, isModal));
|
||||
|
||||
List<TableChooserDialog> list = programToDialogMap.get(program);
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
programToDialogMap.put(program, list);
|
||||
}
|
||||
List<TableChooserDialog> list =
|
||||
programToDialogMap.computeIfAbsent(program, p -> new ArrayList<>());
|
||||
list.add(dialog);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -52,10 +52,6 @@ public class GhidraScriptTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
private Program program;
|
||||
private GhidraState state;
|
||||
|
||||
public GhidraScriptTest() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
|
||||
|
@ -522,7 +518,9 @@ public class GhidraScriptTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
// Try to set a valid option to an invalid value and verify that the invalid value was not stored.
|
||||
String invalidValue = "d";
|
||||
script.setAnalysisOption(program, validOptionName, invalidValue);
|
||||
assertFalse(script.getCurrentAnalysisOptionsAndValues(program).get(validOptionName).equals(
|
||||
assertFalse(script.getCurrentAnalysisOptionsAndValues(program)
|
||||
.get(validOptionName)
|
||||
.equals(
|
||||
invalidValue));
|
||||
|
||||
// Try to set an invalid option and verify that the option is not successfully set.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue