GridLienzoScrollBars { Double getVerticalScrollPosition() { final Integer scrollTop = scrollPanel().getElement().getScrollTop(); final Integer scrollHeight = scrollPanel().getElement().getScrollHeight(); final Integer clientHeight = scrollPanel().getElement().getClientHeight(); final Integer level = scrollHeight - clientHeight; return level == 0 ? 0d : 100d * scrollTop / level; } GridLienzoScrollBars(final GridLienzoScrollHandler gridLienzoScrollHandler);   }
@Test public void testGetVerticalScrollPosition() { doReturn(scrollPanel()).when(gridLienzoScrollHandler).getScrollPanel(); final Double position = gridLienzoScrollBars.getVerticalScrollPosition(); assertEquals(100d * SCROLL_TOP / (SCROLL_HEIGHT - CLIENT_HEIGHT), position, 0); }
@Test public void testGetVerticalScrollPositionWhenScrollbarIsDisabled() { doReturn(emptyPanel()).when(gridLienzoScrollHandler).getScrollPanel(); final Double position = gridLienzoScrollBars.getVerticalScrollPosition(); assertEquals(0, position, 0); }