use of org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView in project tracecompass by tracecompass.
the class FlameChartViewTest method goToTime.
private static void goToTime(long timestamp) {
ITmfTimestamp time = TmfTimestamp.fromNanos(timestamp);
SWTBotTable table = sfBot.activeEditor().bot().table();
table.setFocus();
WaitUtils.waitForJobs();
TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(table.widget, time));
sfBot.waitUntil(ConditionHelpers.selectionInEventsTable(sfBot, timestamp));
final SWTBotView viewBot = sfBot.viewById(FlameChartView.ID);
IWorkbenchPart part = viewBot.getViewReference().getPart(false);
sfBot.waitUntil(ConditionHelpers.timeGraphIsReadyCondition((AbstractTimeGraphView) part, new TmfTimeRange(time, time), time));
}
use of org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView in project tracecompass by tracecompass.
the class PinAndCloneTest method testFollow.
/**
* Test the follow time updates functionality
*/
@Test
public void testFollow() {
TmfTraceManager traceManager = TmfTraceManager.getInstance();
ITmfTrace ust = traceManager.getActiveTrace();
assertNotNull(ust);
ITmfTrace kernelTest = CtfTmfTestTraceUtils.getTrace(CtfTestTrace.CONTEXT_SWITCHES_KERNEL);
SWTBotUtils.openTrace(TRACE_PROJECT_NAME, kernelTest.getPath(), TRACETYPE_ID);
/* Finish waiting for the trace to index */
WaitUtils.waitForJobs();
SWTBotEditor kernelEditor = SWTBotUtils.activateEditor(fBot, kernelTest.getName());
// wait for the editor to be ready.
fBot.editorByTitle(kernelTest.getName());
ITmfTrace kernel = traceManager.getActiveTrace();
assertNotNull(kernel);
SWTBotTable kernelEventTable = kernelEditor.bot().table();
SWTBotTableItem kernelEvent = kernelEventTable.getTableItem(5);
kernelEvent.contextMenu(FOLLOW_TIME_UPDATES_FROM_OTHER_TRACES).click();
SWTBotUtils.activateEditor(fBot, ust.getName());
TmfSignalManager.dispatchSignal(new TmfWindowRangeUpdatedSignal(this, RANGE, ust));
// assert that the kernel trace followed the ust trace's range
IWorkbenchPart part = fOriginalViewBot.getViewReference().getPart(false);
assertTrue(part instanceof AbstractTimeGraphView);
AbstractTimeGraphView abstractTimeGraphView = (AbstractTimeGraphView) part;
fBot.waitUntil(ConditionHelpers.timeGraphRangeCondition(abstractTimeGraphView, ust, RANGE));
SWTBotUtils.activateEditor(fBot, kernel.getName());
fBot.waitUntil(ConditionHelpers.timeGraphRangeCondition(abstractTimeGraphView, kernel, RANGE));
// unfollow (don't use context menu on table item to avoid updating selection)
kernelEventTable.contextMenu(FOLLOW_TIME_UPDATES_FROM_OTHER_TRACES).click();
TmfSignalManager.dispatchSignal(new TmfWindowRangeUpdatedSignal(this, ust.getInitialTimeRange(), ust));
fBot.waitUntil(ConditionHelpers.timeGraphRangeCondition(abstractTimeGraphView, kernel, RANGE));
kernelTest.dispose();
}
use of org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView in project tracecompass by tracecompass.
the class PinAndCloneTest method testCloneSingleTrace.
/**
* Test the cloning feature.
*/
@Test
public void testCloneSingleTrace() {
// single trace.
SWTBotMenu cloneMenu = fOriginalViewBot.viewMenu().menu(NEW_VIEW_MENU);
/*
* assert that the original editor was not renamed and that the cloned one
* exists and is pinned to the UST trace.
*/
cloneMenu.menu(PINNED_TO_PREFIX + fUstTestTrace.getName()).click();
assertOriginalViewTitle(TIME_GRAPH_VIEW_TITLE);
SWTBotView clonedView = fBot.viewByTitle(PINNED_TO_UST_TIME_GRAPH_VIEW_TITLE);
assertEquals("Should not have created a new instance", 1, fBot.editors().size());
clonedView.close();
/*
* Assert that a new instance is created.
*/
cloneMenu.menu(PINNED_TO_PREFIX + fUstTestTrace.getName() + " | new instance").click();
assertOriginalViewTitle(TIME_GRAPH_VIEW_TITLE);
clonedView = fBot.viewByTitle(PINNED_TO_UST_TIME_GRAPH_VIEW_TITLE2);
assertEquals("Should have created a new instance", 2, fBot.editors().size());
SWTBotEditor cloneEditor = fBot.editorByTitle(fUstTestTrace.getName() + CLONED_TRACE_SUFFIX);
// Get the window range of the cloned trace
TmfTraceManager traceManager = TmfTraceManager.getInstance();
ITmfTrace cloneTrace = traceManager.getActiveTrace();
assertNotNull(cloneTrace);
// go back to original trace, pin it
SWTBotUtils.activateEditor(fBot, fUstTestTrace.getName());
fOriginalViewBot.toolbarButton(PIN_VIEW_BUTTON_NAME).click();
ITmfTrace ust = traceManager.getActiveTrace();
TmfSignalManager.dispatchSignal(new TmfWindowRangeUpdatedSignal(this, RANGE, ust));
// assert that the cloned trace's window range did not change
SWTBotUtils.activateEditor(fBot, cloneTrace.getName() + CLONED_TRACE_SUFFIX);
IWorkbenchPart part = clonedView.getViewReference().getPart(false);
assertTrue(part instanceof AbstractTimeGraphView);
AbstractTimeGraphView abstractTimeGraphView = (AbstractTimeGraphView) part;
fBot.waitUntil(ConditionHelpers.timeGraphRangeCondition(abstractTimeGraphView, cloneTrace, INITIAL_UST_RANGE));
cloneEditor.close();
}
use of org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView in project tracecompass by tracecompass.
the class MarkerSetSwtBotTest method testNavigateBetweenMarkers.
/**
* Test navigation between markers
*/
@Test
public void testNavigateBetweenMarkers() {
AbstractTimeGraphView part = (AbstractTimeGraphView) fViewBot.getViewReference().getPart(false);
TmfSignalManager.dispatchSignal(new TmfWindowRangeUpdatedSignal(this, fFullRange));
fBot.waitUntil(ConditionHelpers.windowRange(fFullRange));
insertContent();
fViewBot.setFocus();
SWTBotRootMenu viewMenu = fViewBot.viewMenu();
viewMenu.menu("Marker Set", "Set A").click();
fBot.waitUntil(ConditionHelpers.timeGraphIsReadyCondition(part, new TmfTimeRange(TmfTimestamp.fromNanos(fStart), TmfTimestamp.fromNanos(fStart)), TmfTimestamp.fromNanos(fStart)));
fViewBot.toolbarButton("Next Marker").click();
// Marker A-1: period = 10, unit = ns, offset = 0
long period = 10l;
long nextStart = fStart + (period - (fStart % period));
fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TmfTimestamp.fromNanos(nextStart), TmfTimestamp.fromNanos(nextStart + period))));
viewMenu.menu("Show Markers", "Marker A-1").hide();
fViewBot.toolbarButton("Previous Marker").click();
fBot.waitUntil(ConditionHelpers.timeGraphIsReadyCondition(part, new TmfTimeRange(TmfTimestamp.fromNanos(fStart), TmfTimestamp.fromNanos(nextStart)), TmfTimestamp.fromNanos(fStart)));
removeContent();
}
Aggregations