use of org.eclipse.linuxtools.internal.perf.ui.PerfDoubleClickAction in project linuxtools by eclipse.
the class ModelTest method testDoubleClickAction.
@Test
public void testDoubleClickAction() {
TreeParent invisibleRoot = buildModel("resources/defaultevent-data/perf.data", "resources/defaultevent-data/perf.data.txt", "resources/defaultevent-data/perf.data.err.log");
PerfPlugin.getDefault().setModelRoot(invisibleRoot);
// update the model root for the view
PerfCore.refreshView("resources/defaultevent-data/perf.data");
// number of parents excluding invisibleRoot
int numOfParents = getNumberOfParents(invisibleRoot) - 1;
// create a double click action to act on the tree viewer
try {
PerfProfileView view = (PerfProfileView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(PerfPlugin.VIEW_ID);
TreeViewer tv = view.getTreeViewer();
PerfDoubleClickAction dblClick = new PerfDoubleClickAction(tv);
// double click every element
doubleClickAllChildren(invisibleRoot, tv, dblClick);
// If all elements are expanded, this is the number of elements
// in our model that have children.
assertEquals(numOfParents, tv.getExpandedElements().length);
} catch (PartInitException e) {
fail("Failed to open the Profiling View.");
}
}
Aggregations