From: Patrick Tasse Date: Fri, 27 Mar 2015 21:44:24 +0000 (-0400) Subject: swtbot: Fix FilterColorEditorTest failure in Windows X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=3dadb8ca0548f661da1759c550339ac255b4d6c2;p=deliverable%2Ftracecompass.git swtbot: Fix FilterColorEditorTest failure in Windows Due to antialiasing, the pixels that become of the highlighting color were not all of the background color before the highlighting. Change-Id: I91cad37ec4f882385d563488f8ceec737393739c Signed-off-by: Patrick Tasse Reviewed-on: https://git.eclipse.org/r/44789 Reviewed-by: Hudson CI --- diff --git a/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/FilterColorEditorTest.java b/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/FilterColorEditorTest.java index 794e025f09..59edff94e9 100644 --- a/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/FilterColorEditorTest.java +++ b/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/FilterColorEditorTest.java @@ -50,7 +50,6 @@ import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; -import com.google.common.collect.HashMultiset; import com.google.common.collect.Multiset; /** @@ -173,18 +172,12 @@ public class FilterColorEditorTest { assertTrue(colorAfter.contains(fBackground)); assertTrue(colorAfter.contains(fForeground)); assertTrue(colorAfter.contains(YELLOW)); - Multiset diff = HashMultiset.create(); - /* - * make the histogram difference This will allow us to verify what has - * changed in the two images. Hopefully the sum will be zero - */ - for (RGB entry : colorAfter.elementSet()) { - diff.add(entry, Math.abs(colorAfter.count(entry) - colorBefore.count(entry))); - } + /* - * Check that the background became yellow + * Check that some background became yellow. */ - assertEquals(diff.count(fBackground), (diff.count(YELLOW))); + assertTrue(colorAfter.count(fBackground) < colorBefore.count(fBackground)); + assertTrue(colorAfter.count(YELLOW) > colorBefore.count(YELLOW)); } /** @@ -250,8 +243,6 @@ public class FilterColorEditorTest { // toggle filter mode fTableBot.click(0, 0); ImageHelper afterFilter = ImageHelper.grabImage(cellBounds); - // toggle search mode - fTableBot.click(0, 0); List beforeLine = before.getPixelRow(2); List afterLine = after.getPixelRow(2);