Search in sources :

Example 1 with ChartLocationsDialog

use of org.eclipse.linuxtools.internal.valgrind.massif.charting.ChartLocationsDialog in project linuxtools by eclipse.

the class ChartTests method testChartLocationsDialog.

@Test
public void testChartLocationsDialog() throws Exception {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    // $NON-NLS-1$
    doLaunch(config, "testChartCallback");
    MassifViewPart view = (MassifViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
    // peak
    MassifSnapshot snapshot = view.getSnapshots()[7];
    assertTrue(snapshot.isDetailed());
    Shell parent = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
    ChartLocationsDialog dialog = new ChartLocationsDialog(parent);
    dialog.setInput(snapshot);
    dialog.setBlockOnOpen(false);
    dialog.open();
    MassifHeapTreeNode element = snapshot.getRoot().getChildren()[1];
    dialog.getTableViewer().setSelection(new StructuredSelection(element));
    dialog.getOkButton().notifyListeners(SWT.Selection, null);
    dialog.openEditorForResult();
    checkFile(proj.getProject(), element);
    checkLine(element);
}
Also used : ChartLocationsDialog(org.eclipse.linuxtools.internal.valgrind.massif.charting.ChartLocationsDialog) ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) Shell(org.eclipse.swt.widgets.Shell) MassifHeapTreeNode(org.eclipse.linuxtools.internal.valgrind.massif.MassifHeapTreeNode) MassifSnapshot(org.eclipse.linuxtools.internal.valgrind.massif.MassifSnapshot) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) MassifViewPart(org.eclipse.linuxtools.internal.valgrind.massif.MassifViewPart) Test(org.junit.Test)

Aggregations

ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 MassifHeapTreeNode (org.eclipse.linuxtools.internal.valgrind.massif.MassifHeapTreeNode)1 MassifSnapshot (org.eclipse.linuxtools.internal.valgrind.massif.MassifSnapshot)1 MassifViewPart (org.eclipse.linuxtools.internal.valgrind.massif.MassifViewPart)1 ChartLocationsDialog (org.eclipse.linuxtools.internal.valgrind.massif.charting.ChartLocationsDialog)1 Shell (org.eclipse.swt.widgets.Shell)1 Test (org.junit.Test)1