swtbot: Fix FilterColorEditorTest failure in Windows
authorPatrick Tasse <patrick.tasse@gmail.com>
Fri, 27 Mar 2015 21:44:24 +0000 (17:44 -0400)
committerPatrick Tasse <patrick.tasse@gmail.com>
Tue, 31 Mar 2015 15:28:40 +0000 (11:28 -0400)
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 <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/44789
Reviewed-by: Hudson CI
org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/FilterColorEditorTest.java

index 794e025f09808e376272c19325c668f7d3e46c0f..59edff94e90ff5bbd30ce1ddc633b8b34c3c56fe 100644 (file)
@@ -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<RGB> 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<RGB> beforeLine = before.getPixelRow(2);
         List<RGB> afterLine = after.getPixelRow(2);
This page took 0.025476 seconds and 5 git commands to generate.