Search in sources :

Example 36 with SWTBotTimeGraph

use of org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph 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;
}
Also used : SWTBotTimeGraph(org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph) ArrayList(java.util.ArrayList) SWTBotTimeGraphEntry(org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraphEntry)

Example 37 with SWTBotTimeGraph

use of org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph 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())));
}
Also used : SWTBotTimeGraph(org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph) SWTBotTimeGraphEntry(org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraphEntry) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) AggregationTreeTest(org.eclipse.tracecompass.analysis.profiling.core.tests.flamegraph.AggregationTreeTest) Test(org.junit.Test)

Example 38 with SWTBotTimeGraph

use of org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph 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());
}
Also used : SWTBotTimeGraph(org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph) TimeGraphControl(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.TimeGraphControl) SWTBotTimeGraphEntry(org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraphEntry) Test(org.junit.Test)

Aggregations

SWTBotTimeGraph (org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph)38 Test (org.junit.Test)31 TmfTimeRange (org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange)17 SWTBotTimeGraphEntry (org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraphEntry)16 SWTBotView (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)13 TmfSelectionRangeUpdatedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal)13 Point (org.eclipse.swt.graphics.Point)10 TmfWindowRangeUpdatedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal)9 Rectangle (org.eclipse.swt.graphics.Rectangle)8 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)8 SWTBot (org.eclipse.swtbot.swt.finder.SWTBot)7 ImageHelper (org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.ImageHelper)6 RGB (org.eclipse.swt.graphics.RGB)5 SWTBotText (org.eclipse.swtbot.swt.finder.widgets.SWTBotText)5 ArrayList (java.util.ArrayList)4 NonNull (org.eclipse.jdt.annotation.NonNull)4 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)4 IOException (java.io.IOException)3 List (java.util.List)3 SWTWorkbenchBot (org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot)3