GridLienzoScrollBars { void setHorizontalScrollPosition(final Double percentage) { final Integer scrollWidth = scrollPanel().getElement().getScrollWidth(); final Integer clientWidth = scrollPanel().getElement().getClientWidth(); final Integer max = scrollWidth - clientWidth; setScrollLeft((int) ((max * percentage) / 100)); } GridLienzoScrollBars(final GridLienzoScrollHandler gridLienzoScrollHandler);   }
@Test public void testSetHorizontalScrollPosition() { doReturn(scrollPanel()).when(gridLienzoScrollHandler).getScrollPanel(); final Double percentage = 100d * SCROLL_LEFT / (SCROLL_WIDTH - CLIENT_WIDTH); gridLienzoScrollBars.setHorizontalScrollPosition(percentage); verify(gridLienzoScrollBars).setScrollLeft(eq(SCROLL_LEFT)); }