mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-22 12:11:55 +00:00
Merge remote-tracking branch 'origin/GP-3848-dragonmacher-task-launcher-headless'
This commit is contained in:
commit
4f867c099e
@ -113,6 +113,10 @@ class TaskRunner {
|
||||
|
||||
private void showTaskDialog(WrappingTaskMonitor monitor) {
|
||||
|
||||
if (SystemUtilities.isInHeadlessMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Swing.runIfSwingOrRunLater(() -> {
|
||||
taskDialog = buildTaskDialog();
|
||||
monitor.setDelegate(taskDialog); // initialize the dialog to the current monitor state
|
||||
|
@ -22,6 +22,8 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import ghidra.util.SystemUtilities;
|
||||
|
||||
public class TaskLauncherTest extends AbstractTaskTest {
|
||||
|
||||
private Thread swingThread;
|
||||
@ -114,6 +116,24 @@ public class TaskLauncherTest extends AbstractTaskTest {
|
||||
totalTime < dialogDelay);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHeadless() throws Exception {
|
||||
|
||||
System.setProperty(SystemUtilities.HEADLESS_PROPERTY, Boolean.TRUE.toString());
|
||||
|
||||
SwingBlocker blocker = new SwingBlocker();
|
||||
runSwing(blocker, false);
|
||||
blocker.waitForStart();
|
||||
|
||||
// 4 - 2 per task
|
||||
threadsFinished = new CountDownLatch(4);
|
||||
launchTaskFromTask();
|
||||
waitForTask();
|
||||
assertDidNotRunInSwing();
|
||||
|
||||
assertNull(taskDialog);
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
// Private Methods
|
||||
//==================================================================================================
|
||||
|
Loading…
Reference in New Issue
Block a user