use of org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraphEntry in project tracecompass by tracecompass.
the class TimeGraphViewTest method testTimeLine.
/**
* Test the line entries
*/
@Test
public void testTimeLine() {
String lines = "pulse";
resetTimeRange();
SWTBotTimeGraph timegraph = fTimeGraph;
assertEquals(0, timegraph.selection().columnCount());
ImageHelper currentImage = ImageHelper.waitForNewImage(fBounds, null);
SWTBotTimeGraphEntry entry = timegraph.getEntry(lines);
// make sure it's visible
entry = timegraph.getEntry(lines).select();
ImageHelper.waitForNewImage(fBounds, currentImage);
Rectangle rect = entry.absoluteLocation();
ImageHelper image = ImageHelper.grabImage(rect);
ImmutableMultiset<RGB> ms = Multisets.copyHighestCountFirst(image.getHistogram());
int black = ms.count(new RGB(0, 0, 0));
RGB bgColor = ms.elementSet().iterator().next();
int bgCount = ms.count(bgColor);
float actual = ((float) black) / (bgCount);
assertEquals(0.113f, actual, 0.05f);
}
use of org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraphEntry in project tracecompass by tracecompass.
the class FlameChartViewTest method getVisibleStackFrames.
private static List<String> getVisibleStackFrames(final SWTBotView viewBot) {
SWTBotTimeGraph timeGraph = new SWTBotTimeGraph(viewBot.bot());
List<String> stackFrames = new ArrayList<>();
for (SWTBotTimeGraphEntry entry : timeGraph.getEntry(TRACE, PROCESS, THREAD).getEntries()) {
String name = entry.getText();
if (!name.isEmpty()) {
stackFrames.add(name);
}
}
return stackFrames;
}
use of org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraphEntry in project tracecompass by tracecompass.
the class FlameGraphTest method tryMouseDoubleclickZoom.
/**
* Try to zoom by doubleclicking an event
*
* @throws InterruptedException
* on interruption
*/
@Test
public void tryMouseDoubleclickZoom() throws InterruptedException {
super.treeTest();
loadFlameGraph();
SWTBotTimeGraph sbtg = new SWTBotTimeGraph(fView.bot());
// Test the number of timegraph entries in the graph
SWTBotTimeGraphEntry sbtge = sbtg.getEntry("");
assertEquals(3, sbtge.getEntries().length);
SWTBotTimeGraphEntry actualEntry = sbtge.getEntry("1");
actualEntry.doubleClick(40);
fFg.waitForUpdate();
assertEquals(new TmfTimeRange(TmfTimestamp.fromNanos(0), TmfTimestamp.fromNanos(80)), new TmfTimeRange(TmfTimestamp.fromNanos(fTimeGraphViewer.getTime0()), TmfTimestamp.fromNanos(fTimeGraphViewer.getTime1())));
}
use of org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraphEntry in project tracecompass by tracecompass.
the class XmlTimegraphViewTest method testData.
/**
* Test that the timegraph view is open and is populated
*/
@Test
public void testData() {
SWTBotTimeGraph timegraph = getTimegraph();
// Test the window range
TimeGraphControl widget = timegraph.widget;
SWTBotUtils.waitUntil(control -> control.getTimeDataProvider().getTime0() == 1, widget, "window start time");
SWTBotUtils.waitUntil(control -> control.getTimeDataProvider().getTime1() == 7, widget, "window end time");
// test entries
SWTBotTimeGraphEntry traceEntry = timegraph.getEntry(TRACE_NAME);
SWTBotTimeGraphEntry entry = traceEntry.getEntry("checkpoint");
assertEquals("number of entries", 1, timegraph.getEntries().length);
assertEquals("number of entries", 1, traceEntry.getEntries().length);
assertEquals("name of entry", "checkpoint", entry.getText());
}
Aggregations