use of org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph in project tracecompass by tracecompass.
the class ResourcesViewTest method testAddRemoveBookmark.
/**
* Test tool bar button "Add Bookmark..." and "Remove Bookmark"
*/
@Test
public void testAddRemoveBookmark() {
SWTBotView viewBot = getViewBot();
/* change window range to 10 ms */
TmfTimeRange range = new TmfTimeRange(START_TIME, START_TIME.normalize(10000000L, ITmfTimestamp.NANOSECOND_SCALE));
TmfSignalManager.dispatchSignal(new TmfWindowRangeUpdatedSignal(this, range));
fBot.waitUntil(ConditionHelpers.windowRange(range));
/* set selection to trace start time */
TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, START_TIME));
timeGraphIsReadyCondition(new TmfTimeRange(START_TIME, START_TIME), START_TIME);
/* set focus on time graph */
SWTBotTimeGraph timeGraph = new SWTBotTimeGraph(viewBot.bot());
timeGraph.setFocus();
/* select first CPU resource */
timeGraph.getEntry(LttngTraceGenerator.getName(), CPU0_THREADS).select();
/* click "Select Next State Change" 2 times */
viewBot.toolbarButton(SELECT_NEXT_STATE_CHANGE).click();
timeGraphIsReadyCondition(new TmfTimeRange(CPU0_TIME1, CPU0_TIME1), CPU0_TIME1);
viewBot.toolbarButton(SELECT_NEXT_STATE_CHANGE).click();
timeGraphIsReadyCondition(new TmfTimeRange(CPU0_TIME2, CPU0_TIME2), CPU0_TIME2);
/* click "Add Bookmark..." and fill Add Bookmark dialog */
viewBot.toolbarButton(ADD_BOOKMARK).click();
SWTBot dialogBot = fBot.shell(ADD_BOOKMARK_DIALOG).bot();
dialogBot.text().setText("B1");
dialogBot.button(OK).click();
/*
* click "Select Next State Change" 2 times and shift-click "Select Next
* State Change
*/
viewBot.toolbarButton(SELECT_NEXT_STATE_CHANGE).click();
timeGraphIsReadyCondition(new TmfTimeRange(CPU0_TIME3, CPU0_TIME3), CPU0_TIME3);
viewBot.toolbarButton(SELECT_NEXT_STATE_CHANGE).click();
timeGraphIsReadyCondition(new TmfTimeRange(CPU0_TIME4, CPU0_TIME4), CPU0_TIME4);
viewBot.toolbarButton(SELECT_NEXT_STATE_CHANGE).click(SWT.SHIFT);
timeGraphIsReadyCondition(new TmfTimeRange(CPU0_TIME4, CPU0_TIME5), CPU0_TIME5);
/* click "Add Bookmark..." and fill Add Bookmark dialog */
viewBot.toolbarButton(ADD_BOOKMARK).click();
dialogBot = fBot.shell(ADD_BOOKMARK_DIALOG).bot();
dialogBot.text().setText("B2");
dialogBot.button(OK).click();
/* click "Previous Marker" */
viewBot.toolbarButton(PREVIOUS_MARKER).click();
timeGraphIsReadyCondition(new TmfTimeRange(CPU0_TIME2, CPU0_TIME2), CPU0_TIME2);
/* click "Remove Bookmark" */
viewBot.toolbarButton(REMOVE_BOOKMARK).click();
/* click "Next Marker" */
viewBot.toolbarButton(NEXT_MARKER).click();
timeGraphIsReadyCondition(new TmfTimeRange(CPU0_TIME4, CPU0_TIME5), CPU0_TIME5);
/* click "Remove Bookmark" */
viewBot.toolbarButton(REMOVE_BOOKMARK).click();
/* click "Previous Marker" */
viewBot.toolbarButton(PREVIOUS_MARKER).click();
timeGraphIsReadyCondition(new TmfTimeRange(CPU0_TIME4, CPU0_TIME5), CPU0_TIME5);
/* click "Select Previous State Change" */
viewBot.toolbarButton(SELECT_PREVIOUS_STATE_CHANGE).click();
timeGraphIsReadyCondition(new TmfTimeRange(CPU0_TIME4, CPU0_TIME4), CPU0_TIME4);
}
use of org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph in project tracecompass by tracecompass.
the class ResourcesViewTest method testNextPreviousMarker.
private void testNextPreviousMarker(Runnable nextMarker, Runnable shiftNextMarker, Runnable previousMarker, Runnable shiftPreviousMarker) {
SWTBotView viewBot = getViewBot();
/* set selection to trace start time */
TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, START_TIME));
timeGraphIsReadyCondition(new TmfTimeRange(START_TIME, START_TIME), START_TIME);
/* set focus on time graph */
SWTBotTimeGraph timeGraph = new SWTBotTimeGraph(viewBot.bot());
timeGraph.setFocus();
/* select first item */
timeGraph.getEntry(LttngTraceGenerator.getName()).select();
/* click "Next Marker" 3 times */
nextMarker.run();
timeGraphIsReadyCondition(new TmfTimeRange(LOST_EVENT_TIME1, LOST_EVENT_END1), LOST_EVENT_TIME1);
nextMarker.run();
timeGraphIsReadyCondition(new TmfTimeRange(LOST_EVENT_TIME2, LOST_EVENT_END2), LOST_EVENT_TIME2);
nextMarker.run();
timeGraphIsReadyCondition(new TmfTimeRange(LOST_EVENT_TIME3, LOST_EVENT_END3), LOST_EVENT_TIME3);
/* shift-click "Previous Marker" 3 times */
shiftPreviousMarker.run();
timeGraphIsReadyCondition(new TmfTimeRange(LOST_EVENT_TIME3, LOST_EVENT_TIME3), LOST_EVENT_TIME3);
shiftPreviousMarker.run();
timeGraphIsReadyCondition(new TmfTimeRange(LOST_EVENT_TIME3, LOST_EVENT_TIME2), LOST_EVENT_TIME2);
shiftPreviousMarker.run();
timeGraphIsReadyCondition(new TmfTimeRange(LOST_EVENT_TIME3, LOST_EVENT_TIME1), LOST_EVENT_TIME1);
/* shift-click "Next Marker" 3 times */
shiftNextMarker.run();
timeGraphIsReadyCondition(new TmfTimeRange(LOST_EVENT_TIME3, LOST_EVENT_END1), LOST_EVENT_END1);
shiftNextMarker.run();
timeGraphIsReadyCondition(new TmfTimeRange(LOST_EVENT_TIME3, LOST_EVENT_END2), LOST_EVENT_END2);
shiftNextMarker.run();
timeGraphIsReadyCondition(new TmfTimeRange(LOST_EVENT_TIME3, LOST_EVENT_END3), LOST_EVENT_END3);
/* click "Previous Marker" 3 times */
previousMarker.run();
timeGraphIsReadyCondition(new TmfTimeRange(LOST_EVENT_TIME2, LOST_EVENT_END2), LOST_EVENT_TIME2);
previousMarker.run();
timeGraphIsReadyCondition(new TmfTimeRange(LOST_EVENT_TIME1, LOST_EVENT_END1), LOST_EVENT_TIME1);
previousMarker.run();
timeGraphIsReadyCondition(new TmfTimeRange(LOST_EVENT_TIME1, LOST_EVENT_END1), LOST_EVENT_TIME1);
}
use of org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph in project tracecompass by tracecompass.
the class TimeGraphViewUiContextTestBase method testHideEmptyRowsState.
/**
* Test Hide Empty Rows filter state persistence.
*/
@Test
public void testHideEmptyRowsState() {
// Select editor
SWTBotTimeGraph timegraphBot = new SWTBotTimeGraph(getViewBot().bot());
SWTBotUtils.activateEditor(fBot, BUG446190);
SWTBotUtils.waitUntil(root -> timegraphBot.getEntries()[0].getText().equals(root), BUG446190, "Failed to activate editor " + BUG446190);
// expand all entries
timegraphBot.expandAll();
int count = getVisibleItems(timegraphBot);
SWTBotToolbarToggleButton button = getViewBot().toolbarToggleButton(HIDE_EMPTY_ROWS);
button.click();
assertTrue(button.isChecked());
/* Verify that number active entries changed */
SWTBotUtils.waitUntil(graph -> getVisibleItems(graph) < count, timegraphBot, () -> "More number of visible entries expected: (count: " + count + ", actual: " + getVisibleItems(timegraphBot) + ")");
// Switch trace
SWTBotUtils.activateEditor(fBot, FLIPPING_ENDIANNESS);
SWTBotUtils.waitUntil(root -> timegraphBot.getEntries()[0].getText().equals(root), FLIPPING_ENDIANNESS, "Failed to activate editor " + FLIPPING_ENDIANNESS);
button = getViewBot().toolbarToggleButton(HIDE_EMPTY_ROWS);
assertFalse(button.isChecked());
// Switch trace
SWTBotUtils.activateEditor(fBot, BUG446190);
SWTBotUtils.waitUntil(root -> timegraphBot.getEntries()[0].getText().equals(root), BUG446190, "Failed to activate editor " + FLIPPING_ENDIANNESS);
button = getViewBot().toolbarToggleButton(HIDE_EMPTY_ROWS);
assertTrue(button.isChecked());
/* Verify that number active entries changed */
SWTBotUtils.waitUntil(graph -> getVisibleItems(graph) < count, timegraphBot, () -> "More number of visible entries expected: (count: " + count + ", actual: " + getVisibleItems(timegraphBot) + ")");
button = getViewBot().toolbarToggleButton(HIDE_EMPTY_ROWS);
button.click();
assertFalse(button.isChecked());
/* Verify that number active entries changed */
SWTBotUtils.waitUntil(graph -> getVisibleItems(graph) == count, timegraphBot, () -> "More number of visible entries expected: (count: " + count + ", actual: " + getVisibleItems(timegraphBot) + ")");
}
use of org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph in project tracecompass by tracecompass.
the class XmlTimegraphViewTest method getTimegraph.
private static SWTBotTimeGraph getTimegraph() {
SWTBotView viewBot = fBot.viewById(XmlTimeGraphView.ID);
SWTBotTimeGraph timegraph = new SWTBotTimeGraph(viewBot.bot());
assertTrue("timegraph visible", timegraph.isVisible());
timegraph.setFocus();
return timegraph;
}
use of org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph in project tracecompass by tracecompass.
the class FlameChartViewTest method testGoToTimeAndCheckStackWithNames.
/**
* Test check callstack at a time with function map
*
* @throws IOException
* Missing file
*/
@Test
public void testGoToTimeAndCheckStackWithNames() throws IOException {
goToTime(TIMESTAMPS[0]);
final SWTBotView viewBot = sfBot.viewById(FlameChartView.ID);
viewBot.setFocus();
URL mapUrl = CtfTmfTestTraceUtils.class.getResource("cyg-profile-mapping.txt");
String absoluteFile = FileLocator.toFileURL(mapUrl).getFile();
TmfFileDialogFactory.setOverrideFiles(absoluteFile);
SWTBotShell shell = openSymbolProviderDialog();
SWTBot shellBot = shell.bot();
shellBot.button("Add...").click();
shellBot.button("OK").click();
shellBot.waitUntil(Conditions.shellCloses(shell));
SWTBotTimeGraph timeGraph = new SWTBotTimeGraph(viewBot.bot());
SWTBotTimeGraphEntry[] threads = timeGraph.getEntry(TRACE, PROCESS).getEntries();
assertEquals(1, threads.length);
assertEquals(THREAD, threads[0].getText(0));
waitForSymbolNames("main", "event_loop", "handle_event");
}
Aggregations