Skip to content

Commit 770fa7c

Browse files
committed
releng: Fix SWTBot tests for 4.36 platform
The default editor for unrecognized files is now the Generic Editor. Wait for stable reference image in TimeGraphViewTest. Signed-off-by: Patrick Tasse <[email protected]>
1 parent 501e408 commit 770fa7c

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

releng/org.eclipse.tracecompass.integration.swtbot.tests/src/org/eclipse/tracecompass/integration/swtbot/tests/projectexplorer/ProjectExplorerTracesFolderTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313

1414
import static org.junit.Assert.assertEquals;
1515
import static org.junit.Assert.assertNotEquals;
16+
import static org.junit.Assert.assertTrue;
1617
import static org.junit.Assert.fail;
1718

1819
import java.io.File;
1920
import java.io.IOException;
21+
import java.util.Arrays;
2022
import java.util.List;
2123
import java.util.Set;
2224
import java.util.function.Supplier;
@@ -91,6 +93,7 @@ public ImportConfirmation get() {
9193

9294
private static final String PROP_LAST_MODIFIED_PROPERTY = "last modified";
9395
private static final String TEXT_EDITOR_ID = "org.eclipse.ui.DefaultTextEditor";
96+
private static final String GENERIC_EDITOR_ID = "org.eclipse.ui.genericeditor.GenericEditor";
9497

9598
private static final String GENERIC_CTF_TRACE_TYPE = "Common Trace Format : Generic CTF Trace";
9699
private static final String LTTNG_KERNEL_TRACE_TYPE = "Common Trace Format : Linux Kernel Trace";
@@ -1524,7 +1527,7 @@ private static void verifyTrace(TestTraceInfo traceInfo, int importOptionFlags,
15241527
// If there is no trace type, make sure it can be opened with the text editor
15251528
fBot.waitUntil(ConditionHelpers.isEditorOpened(fBot, traceName));
15261529
SWTBotEditor editor = fBot.editorByTitle(traceName);
1527-
assertEquals(TEXT_EDITOR_ID, editor.getReference().getId());
1530+
assertTrue(editor.getReference().getId(), Arrays.asList(TEXT_EDITOR_ID, GENERIC_EDITOR_ID).contains(editor.getReference().getId()));
15281531
}
15291532
checkTraceLinked(traceItem, (importOptionFlags & ImportTraceWizardPage.OPTION_CREATE_LINKS_IN_WORKSPACE) != 0);
15301533
}

tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/views/TimeGraphViewTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**********************************************************************
2-
* Copyright (c) 2017, 2020 Ericsson
2+
* Copyright (c) 2017, 2025 Ericsson
33
*
44
* All rights reserved. This program and the accompanying materials are
55
* made available under the terms of the Eclipse Public License 2.0 which
@@ -329,7 +329,7 @@ public void testLegendArrow() {
329329
resetTimeRange();
330330
Rectangle bounds = fBounds;
331331

332-
ImageHelper ref = ImageHelper.grabImage(bounds);
332+
ImageHelper ref = ImageHelper.waitForNewImage(bounds, null);
333333

334334
// Set the widths to 0.25
335335

@@ -550,7 +550,7 @@ public void testLegend() {
550550
resetTimeRange();
551551
Rectangle bounds = fBounds;
552552

553-
ImageHelper ref = ImageHelper.grabImage(bounds);
553+
ImageHelper ref = ImageHelper.waitForNewImage(bounds, null);
554554

555555
// Set the widths to 0.25
556556

@@ -721,7 +721,7 @@ public void testVerticalZoom() {
721721
SWTBotTimeGraph timegraph = fTimeGraph;
722722
Rectangle bounds = fBounds;
723723

724-
ImageHelper ref = ImageHelper.grabImage(bounds);
724+
ImageHelper ref = ImageHelper.waitForNewImage(bounds, null);
725725

726726
fireKeyAndWait(timegraph, bounds, false, '+', SWT.CTRL);
727727
fireKeyAndWait(timegraph, bounds, false, '-', SWT.CTRL);
@@ -1088,7 +1088,7 @@ public void testTimegraphEventFiltering() {
10881088

10891089
Rectangle bounds = fBounds;
10901090

1091-
ImageHelper ref = ImageHelper.grabImage(bounds);
1091+
ImageHelper ref = ImageHelper.waitForNewImage(bounds, null);
10921092

10931093
timegraph.setFocus();
10941094
// Move mouse to middle of the timegraph

0 commit comments

Comments
 (0)