]> source.dussan.org Git - vaadin-framework.git/commitdiff
Grid horizontal scrolling fix for Chrome. (#8031)
authorDenis <denis@vaadin.com>
Mon, 19 Dec 2016 09:43:19 +0000 (11:43 +0200)
committerHenri Sara <henri.sara@gmail.com>
Mon, 19 Dec 2016 09:43:19 +0000 (11:43 +0200)
uitest/src/test/java/com/vaadin/tests/components/grid/HorizontalScrollAfterResizeTest.java

index fcc9681b61bd69a690d662002a2c336b742b0d46..fa612b1a2857633a45aa2f48a0ed1feeb4b6924f 100644 (file)
@@ -52,13 +52,16 @@ public class HorizontalScrollAfterResizeTest extends GridBasicFeaturesTest {
         // second scroll to the right
         scrollGridHorizontallyTo(600);
 
-        Point lolocationAfterSecondScrollcation = $(GridElement.class).first()
+        Point locationAfterSecondScrollcation = $(GridElement.class).first()
                 .getCell(0, 9).getLocation();
 
-        // With the bug scrolling doesn't happen. Location should be the same as
-        // first time
-        Assert.assertEquals(locationAfterFirstScroll,
-                lolocationAfterSecondScrollcation);
+        // With the bug scrolling doesn't happen. Location should be around of
+        // the initial scrolling
+        Assert.assertEquals(locationAfterFirstScroll.getY(),
+                locationAfterSecondScrollcation.getY());
+        int delta = 5;
+        Assert.assertTrue(Math.abs(locationAfterFirstScroll.getX()
+                - locationAfterSecondScrollcation.getX()) < delta);
     }
 
     @Override