mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GP-1512 - fixed failing screenshot
This commit is contained in:
parent
1eafc9a78a
commit
e30884b229
3 changed files with 49 additions and 45 deletions
Binary file not shown.
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 110 KiB |
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
package help.screenshot;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.geom.GeneralPath;
|
||||
|
@ -1275,13 +1275,16 @@ public abstract class AbstractScreenShotGenerator extends AbstractGhidraHeadedIn
|
|||
|
||||
}
|
||||
|
||||
public void positionListingTop(final long address) {
|
||||
runSwing(() -> {
|
||||
public void positionListingTop(long address) {
|
||||
boolean didGoTo = runSwing(() -> {
|
||||
CodeBrowserPlugin plugin = getPlugin(tool, CodeBrowserPlugin.class);
|
||||
FieldPanel fieldPanel = plugin.getFieldPanel();
|
||||
plugin.goToField(addr(address), AddressFieldFactory.FIELD_NAME, 0, 0);
|
||||
boolean result = plugin.goToField(addr(address), AddressFieldFactory.FIELD_NAME, 0, 0);
|
||||
fieldPanel.positionCursor(0);
|
||||
return result;
|
||||
});
|
||||
|
||||
assertTrue("Go To failed for address: " + address, didGoTo);
|
||||
}
|
||||
|
||||
public void positionListingCenter(final long address) {
|
||||
|
|
|
@ -144,15 +144,16 @@ public class CodeBrowserPluginScreenShots extends GhidraScreenShotGenerator {
|
|||
@Test
|
||||
public void testCaptureSelectionTable() {
|
||||
setToolSize(1100, 700);
|
||||
positionListingTop(0x0406bd7);
|
||||
makeSelection(0x0406be1, 0x0406bf1);
|
||||
positionListingTop(0x0406bd5);
|
||||
makeSelection(0x0406be1, 0x0406bf6);
|
||||
|
||||
performAction("Create Table From Selection", "CodeBrowserPlugin", true);
|
||||
Window window = waitForWindowByTitleContaining("Selection Table");
|
||||
Point loc = plugin.getListingPanel().getLocationOnScreen();
|
||||
Dimension size = window.getSize();
|
||||
window.setBounds(loc.x + 300, loc.y + 150, size.width, 300);
|
||||
captureProvider(CodeViewerProvider.class);
|
||||
CodeViewerProvider provider = getProvider(CodeViewerProvider.class);
|
||||
captureProviderWithScreenShot(provider);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue