Search in sources :

Example 6 with AbstractTimeGraphView

use of org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView in project tracecompass by tracecompass.

the class ControlFlowViewTest method timeGraphIsReadyCondition.

private void timeGraphIsReadyCondition(@NonNull TmfTimeRange selectionRange) {
    IWorkbenchPart part = getViewBot().getViewReference().getPart(false);
    fBot.waitUntil(ConditionHelpers.timeGraphIsReadyCondition((AbstractTimeGraphView) part, selectionRange, selectionRange.getEndTime()));
}
Also used : AbstractTimeGraphView(org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart)

Example 7 with AbstractTimeGraphView

use of org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView in project tracecompass by tracecompass.

the class ResourcesViewTest method testShowRows.

/**
 * Test "Show Empty Rows" view menu
 */
@Test
public void testShowRows() {
    SWTBotView viewBot = getViewBot();
    /* change window range to 10 ms */
    TmfTimeRange range = new TmfTimeRange(START_FOR_EMPTY_ROWS_TEST, END_FOR_EMPTY_ROWS_TEST);
    TmfSignalManager.dispatchSignal(new TmfWindowRangeUpdatedSignal(this, range));
    IWorkbenchPart part = viewBot.getViewReference().getPart(false);
    assertTrue(part instanceof AbstractTimeGraphView);
    AbstractTimeGraphView abstractTimeGraphView = (AbstractTimeGraphView) part;
    viewBot.bot().waitUntil(ConditionHelpers.timeGraphRangeCondition(abstractTimeGraphView, Objects.requireNonNull(TmfTraceManager.getInstance().getActiveTrace()), range));
    fBot.waitUntil(ConditionHelpers.windowRange(range));
    SWTBotTimeGraph timeGraph = new SWTBotTimeGraph(viewBot.bot());
    timeGraph.setFocus();
    int count = getVisibleItems(timeGraph);
    viewBot.toolbarButton(HIDE_EMPTY_ROWS).click();
    /* Verify that number active entries changed */
    SWTBotUtils.waitUntil(graph -> getVisibleItems(graph) < count, timeGraph, () -> "Fewer number of visible entries expected: (count: " + count + ", actual: " + getVisibleItems(timeGraph) + ")");
    timeGraph.setFocus();
    viewBot.toolbarButton(HIDE_EMPTY_ROWS).click();
    /* Verify that number active entries changed */
    SWTBotUtils.waitUntil(graph -> getVisibleItems(graph) == count, timeGraph, () -> "More number of visible entries expected: (count: " + count + ", actual: " + getVisibleItems(timeGraph) + ")");
}
Also used : AbstractTimeGraphView(org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) SWTBotTimeGraph(org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph) SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView) TmfWindowRangeUpdatedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) Point(org.eclipse.swt.graphics.Point) Test(org.junit.Test)

Example 8 with AbstractTimeGraphView

use of org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView in project tracecompass by tracecompass.

the class ResourcesViewTest method timeGraphIsReadyCondition.

private void timeGraphIsReadyCondition(@NonNull TmfTimeRange selectionRange, @NonNull ITmfTimestamp visibleTime) {
    IWorkbenchPart part = getViewBot().getViewReference().getPart(false);
    fBot.waitUntil(ConditionHelpers.timeGraphIsReadyCondition((AbstractTimeGraphView) part, selectionRange, visibleTime));
}
Also used : AbstractTimeGraphView(org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart)

Example 9 with AbstractTimeGraphView

use of org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView in project tracecompass by tracecompass.

the class FindDialogTestBase method before.

/**
 * Initialize the test and open the timegraph view and the find dialog
 */
@Before
public void before() {
    String title = getViewTitle();
    fViewBot = fBot.viewByTitle(title);
    fViewBot.show();
    fTimeGraphBot = new SWTBotTimeGraph(fViewBot.bot());
    TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, START_TIME));
    fBot.waitUntil(ConditionHelpers.timeGraphIsReadyCondition((AbstractTimeGraphView) fViewBot.getViewReference().getPart(false), new TmfTimeRange(START_TIME, START_TIME), START_TIME));
    fViewBot.setFocus();
    openDialog(fViewBot);
    fFindText = getFindText();
}
Also used : AbstractTimeGraphView(org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView) TmfSelectionRangeUpdatedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal) SWTBotTimeGraph(org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) Before(org.junit.Before)

Example 10 with AbstractTimeGraphView

use of org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView in project tracecompass by tracecompass.

the class FlameChartViewTest method beforeTest.

/**
 * Open a trace in an editor
 */
@Before
public void beforeTest() {
    SWTBotUtils.createProject(PROJECT_NAME);
    SWTBotTreeItem treeItem = SWTBotUtils.selectTracesFolder(sfBot, PROJECT_NAME);
    assertNotNull(treeItem);
    final CtfTestTrace cygProfile = CtfTestTrace.CYG_PROFILE;
    final File file = new File(CtfTmfTestTraceUtils.getTrace(cygProfile).getPath());
    CtfTmfTestTraceUtils.dispose(cygProfile);
    SWTBotUtils.openTrace(PROJECT_NAME, file.getAbsolutePath(), UST_ID);
    SWTBotUtils.activateEditor(sfBot, file.getName());
    SWTBotUtils.openView(FlameChartView.ID);
    WaitUtils.waitForJobs();
    final SWTBotView viewBot = sfBot.viewById(FlameChartView.ID);
    IWorkbenchPart part = viewBot.getViewReference().getPart(false);
    sfBot.waitUntil(ConditionHelpers.timeGraphIsReadyCondition((AbstractTimeGraphView) part, new TmfTimeRange(START_TIME, START_TIME), START_TIME));
}
Also used : AbstractTimeGraphView(org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) SWTBotTreeItem(org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem) SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) File(java.io.File) CtfTestTrace(org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace) Before(org.junit.Before)

Aggregations

AbstractTimeGraphView (org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView)14 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)11 TmfTimeRange (org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange)7 Test (org.junit.Test)7 TmfWindowRangeUpdatedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal)6 SWTBotView (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)4 ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)4 SWTBotEditor (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor)3 SWTBotTable (org.eclipse.swtbot.swt.finder.widgets.SWTBotTable)3 TmfTraceManager (org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager)3 SWTBotTimeGraph (org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph)3 SWTBotTableItem (org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem)2 TmfSelectionRangeUpdatedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal)2 Before (org.junit.Before)2 File (java.io.File)1 Point (org.eclipse.swt.graphics.Point)1 WidgetNotFoundException (org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)1 DefaultCondition (org.eclipse.swtbot.swt.finder.waits.DefaultCondition)1 SWTBotMenu (org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu)1 SWTBotRootMenu (org.eclipse.swtbot.swt.finder.widgets.SWTBotRootMenu)1