GridLienzoScrollHandler { public Integer scrollbarWidth() { return getScrollPanel().getElement().getOffsetWidth() - getScrollPanel().getElement().getClientWidth(); } GridLienzoScrollHandler(final GridLienzoPanel panel); void init(); Integer scrollbarWidth(); Integer scrollbarHeight(); void refreshScrollPosition(); void setBounds(final Bounds bounds);  }
@Test public void testScrollbarWidth() { final AbsolutePanel scrollPanel = mock(AbsolutePanel.class); final Element element = mock(Element.class); final Integer offsetWidth = 1014; final Integer clientWidth = 1000; doReturn(offsetWidth).when(element).getOffsetWidth(); doReturn(clientWidth).when(element).getClientWidth(); doReturn(element).when(scrollPanel).getElement(); doReturn(scrollPanel).when(gridLienzoScrollHandler).getScrollPanel(); final Integer expectedScrollbarWidth = offsetWidth - clientWidth; final Integer actualScrollbarWidth = gridLienzoScrollHandler.scrollbarWidth(); assertEquals(expectedScrollbarWidth, actualScrollbarWidth); }