Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2018-06-26 13:59:38 +0000
committerNicolas FAUVERGUE2018-07-03 15:08:56 +0000
commit8c848ad6f5ea600dd74c448f631a19042349ba97 (patch)
treed609d701603f6b6aae0cc86b1a8025f00f105c0f /tests/junit/plugins
parent6b3deccc9dc1d98628dfb300fd87f76606ee44ba (diff)
downloadorg.eclipse.papyrus-8c848ad6f5ea600dd74c448f631a19042349ba97.tar.gz
org.eclipse.papyrus-8c848ad6f5ea600dd74c448f631a19042349ba97.tar.xz
org.eclipse.papyrus-8c848ad6f5ea600dd74c448f631a19042349ba97.zip
Bug 535519: [Sequence Diagram] Sequence Diagram layout (& semantics) do
not support DPI scaling https://bugs.eclipse.org/bugs/show_bug.cgi?id=535519 - Initial version: support a labelHeight / labelWidth in CSS - Remove the layout tolerance from the tests Change-Id: Ie46bb206c3046e6111ebaea2a7cc1f66ca09ea15 Signed-off-by: Camille Letavernier <cletavernier@eclipsesource.com>
Diffstat (limited to 'tests/junit/plugins')
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/style.css3
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCombinedFragmentOperandsLayout.java12
2 files changed, 7 insertions, 8 deletions
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/style.css b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/style.css
index eaddd93f659..04b78359071 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/style.css
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/style.css
@@ -1,3 +1,4 @@
* {
- fontName: Roboto; /* Used a fixed font to make sure the layout is deterministic */
+ fontName: Roboto;
+ labelHeight: 15; /* Used a fixed label height to make sure the layout is deterministic (width doesn't matter) */
}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCombinedFragmentOperandsLayout.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCombinedFragmentOperandsLayout.java
index 493b009369e..8ed11ba75f0 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCombinedFragmentOperandsLayout.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCombinedFragmentOperandsLayout.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2018 EclipseSource and others.
+ * Copyright (c) 2018 CEA LIST, EclipseSource and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -69,12 +69,13 @@ public class TestCombinedFragmentOperandsLayout extends AbstractPapyrusTest {
* The value is specified in Pixels.
* </p>
*/
- private static final int LAYOUT_TOLERANCE = 2; // FIXME: When Bug 535061 is fixed, we should be able to set this to 0.
+ // Bug 535519 now allows specifying label sizes in pixels. If tests specify it (e.g. via CSS), we don't need a Tolerance anymore
+ private static final int LAYOUT_TOLERANCE = 0;
/**
- * Size of the CF Label (It is fixed on all platforms, because we use a font explicitly shipped with Papyrus)
+ * Size of the CF Label (It is fixed on all platforms, since it is set in the test stylesheet)
*/
- private static final int CF_LABEL_HEIGHT = 19;
+ private static final int CF_LABEL_HEIGHT = 19; // 15 (Text, from CSS) + two 1px borders above and below
/**
* Initial value for the CF Width
*/
@@ -426,9 +427,6 @@ public class TestCombinedFragmentOperandsLayout extends AbstractPapyrusTest {
private void assertSize(int width, int height, Dimension actual) {
Dimension expected = new Dimension(width, height);
String message = String.format("Expected %s (with a %spx tolerance); got %s", expected, LAYOUT_TOLERANCE, actual);
- // Note: This test only works at 100% DPI Scaling. This is a general SeqD issue
- // that needs to be solved properly. If you're using a 1440p or 4K screen, errors
- // are expected.
Assert.assertTrue(message, getDelta(expected, actual) <= LAYOUT_TOLERANCE);
}

Back to the top