mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
GT-2925 - Key Bindings - Support Window Menu Provider Key Bindings -
test and review fixes
This commit is contained in:
parent
6015650079
commit
a88ecfe6b5
40 changed files with 499 additions and 392 deletions
|
@ -103,16 +103,19 @@ public class FGProvider extends VisualGraphComponentProvider<FGVertex, FGEdge, F
|
|||
controller = new FGController(this, plugin);
|
||||
|
||||
setConnected(isConnected);
|
||||
setIcon(FunctionGraphPlugin.ICON);
|
||||
if (!isConnected) {
|
||||
setTransient();
|
||||
}
|
||||
else {
|
||||
addToToolbar();
|
||||
}
|
||||
|
||||
decorationPanel = new DecoratorPanel(controller.getViewComponent(), isConnected);
|
||||
setWindowMenuGroup(FunctionGraphPlugin.FUNCTION_GRAPH_NAME);
|
||||
setWindowGroup(FunctionGraphPlugin.FUNCTION_GRAPH_NAME);
|
||||
setDefaultWindowPosition(WindowPosition.WINDOW);
|
||||
|
||||
setIcon(FunctionGraphPlugin.ICON, isConnected);
|
||||
setHelpLocation(new HelpLocation("FunctionGraphPlugin", "FunctionGraphPlugin"));
|
||||
|
||||
addToTool();
|
||||
|
|
|
@ -2011,7 +2011,7 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
|
||||
}
|
||||
|
||||
protected FGData triggerPersistence(String functionAddress) {
|
||||
protected FGData triggerPersistenceAndReload(String functionAddress) {
|
||||
//
|
||||
// Ideally, we would like to save, close and re-open the program so that we can get
|
||||
// a round-trip saving and reloading. However, in the test environment, we cannot save
|
||||
|
@ -2019,8 +2019,9 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
// the cache (to make sure that we read the settings again), and then verify that the
|
||||
// data saved in the program has been used to re-group.
|
||||
//
|
||||
graphFunction("0100415a");
|
||||
clearCache();
|
||||
String otherAddress = "0100415a";
|
||||
assertNotEquals(functionAddress, otherAddress);
|
||||
graphFunction(otherAddress);
|
||||
|
||||
//
|
||||
// Graph the original function and make sure that the previously grouped nodes is again
|
||||
|
|
|
@ -90,7 +90,7 @@ public class FunctionGraphGroupVertices1Test extends AbstractFunctionGraphTest {
|
|||
Address minAddress = addresses.getMinAddress();
|
||||
Address maxAddress = addresses.getMaxAddress();
|
||||
|
||||
// Recored the edges for later validate. Note: we have to keep the string form, as the
|
||||
// Record the edges for later validation. Note: we have to keep the string form, as the
|
||||
// toString() on the edges will call back to its vertices, which will later have been
|
||||
// disposed.
|
||||
Collection<FGEdge> oringalGroupedEdges = new HashSet<>(graph.getEdges());// copy so they don't get cleared
|
||||
|
@ -99,7 +99,9 @@ public class FunctionGraphGroupVertices1Test extends AbstractFunctionGraphTest {
|
|||
originalEdgeStrings.add(edge.toString());
|
||||
}
|
||||
|
||||
graphData = triggerPersistence("01002cf5");
|
||||
// debug
|
||||
capture(getPrimaryGraphViewer(), "graph.grouping.before.reload");
|
||||
graphData = triggerPersistenceAndReload("01002cf5");
|
||||
|
||||
waitForAnimation();// the re-grouping may be using animation, which runs after the graph is loaded
|
||||
functionGraph = graphData.getFunctionGraph();
|
||||
|
@ -113,6 +115,7 @@ public class FunctionGraphGroupVertices1Test extends AbstractFunctionGraphTest {
|
|||
// TODO debug - this has failed; suspected timing issue
|
||||
waitForCondition(() -> pointsAreSimilar(location, newLocation));
|
||||
|
||||
capture(getPrimaryGraphViewer(), "graph.grouping.after.reload");
|
||||
assertTrue(
|
||||
"Vertex location not restored to default after performing a relayout " +
|
||||
"original point: " + location + " - reloaded point: " + newLocation,
|
||||
|
@ -292,7 +295,7 @@ public class FunctionGraphGroupVertices1Test extends AbstractFunctionGraphTest {
|
|||
Address secondMinAddress = outerAddresses.getMinAddress();
|
||||
Address secondMaxAddress = outerAddresses.getMaxAddress();
|
||||
|
||||
graphData = triggerPersistence("01002cf5");
|
||||
graphData = triggerPersistenceAndReload("01002cf5");
|
||||
|
||||
waitForAnimation();// the re-grouping may be using animation, which runs after the graph is loaded
|
||||
functionGraph = graphData.getFunctionGraph();
|
||||
|
@ -410,7 +413,7 @@ public class FunctionGraphGroupVertices1Test extends AbstractFunctionGraphTest {
|
|||
Address minAddress = addresses.getMinAddress();
|
||||
Address maxAddress = addresses.getMaxAddress();
|
||||
|
||||
graphData = triggerPersistence("01002cf5");
|
||||
graphData = triggerPersistenceAndReload("01002cf5");
|
||||
|
||||
waitForAnimation();// the re-grouping may be using animation, which runs after the graph is loaded
|
||||
functionGraph = graphData.getFunctionGraph();
|
||||
|
@ -665,7 +668,7 @@ public class FunctionGraphGroupVertices1Test extends AbstractFunctionGraphTest {
|
|||
// Trigger persistence
|
||||
//
|
||||
Address groupAddress = group.getVertexAddress();
|
||||
FGData graphData = triggerPersistence("01002cf5");
|
||||
FGData graphData = triggerPersistenceAndReload("01002cf5");
|
||||
|
||||
//
|
||||
// Retrieve the group and make sure its color is restored
|
||||
|
@ -702,7 +705,7 @@ public class FunctionGraphGroupVertices1Test extends AbstractFunctionGraphTest {
|
|||
// Trigger persistence
|
||||
//
|
||||
Address groupAddress = group.getVertexAddress();
|
||||
FGData graphData = triggerPersistence("01002cf5");
|
||||
FGData graphData = triggerPersistenceAndReload("01002cf5");
|
||||
|
||||
//
|
||||
// Retrieve the group and make sure its color is restored
|
||||
|
@ -745,7 +748,7 @@ public class FunctionGraphGroupVertices1Test extends AbstractFunctionGraphTest {
|
|||
// Trigger persistence
|
||||
//
|
||||
Address groupAddress = group.getVertexAddress();
|
||||
FGData graphData = triggerPersistence("01002cf5");
|
||||
FGData graphData = triggerPersistenceAndReload("01002cf5");
|
||||
|
||||
//
|
||||
// Retrieve the group and make sure its color is restored
|
||||
|
|
|
@ -122,7 +122,7 @@ public class FunctionGraphGroupVertices3Test extends AbstractFunctionGraphTest {
|
|||
uncollapse(groupA);
|
||||
assertUncollapsed(v1, v2);
|
||||
|
||||
triggerPersistence(functionAddress);
|
||||
triggerPersistenceAndReload(functionAddress);
|
||||
waitForBusyGraph();// the re-grouping may be using animation, which runs after the graph is loaded
|
||||
|
||||
v1 = vertex(a1);
|
||||
|
@ -161,7 +161,7 @@ public class FunctionGraphGroupVertices3Test extends AbstractFunctionGraphTest {
|
|||
|
||||
assertUncollapsed(v1, v2);// sanity check--still uncollapsed
|
||||
|
||||
triggerPersistence(functionAddress);
|
||||
triggerPersistenceAndReload(functionAddress);
|
||||
waitForBusyGraph();// the re-grouping may be using animation, which runs after the graph is loaded
|
||||
|
||||
v1 = vertex(a1);
|
||||
|
@ -195,7 +195,7 @@ public class FunctionGraphGroupVertices3Test extends AbstractFunctionGraphTest {
|
|||
uncollapse(outerGroup);
|
||||
assertUncollapsed(innerGroup, v3, v4);
|
||||
|
||||
triggerPersistence(functionAddress);
|
||||
triggerPersistenceAndReload(functionAddress);
|
||||
waitForBusyGraph();// the re-grouping may be using animation, which runs after the graph is loaded
|
||||
|
||||
v1 = vertex(a1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue