GridLienzoScrollHandler { void setupContextSwitcher() { getDomElementContainer().addDomHandler(disablePointerEvents(), MouseWheelEvent.getType()); getPanel().addMouseMoveHandler(enablePointerEvents()); } GridLienzoScrollHandler(final GridLienzoPanel panel); void init(); Integer scrollbarWidth(); Integer scrollbarHeight(); void refreshScrollPosition(); void setBounds(final Bounds bounds);  }
@Test public void testSetupContextSwitcher() { final AbsolutePanel domElementContainer = mock(AbsolutePanel.class); final LienzoPanel lienzoPanel = mock(LienzoPanel.class); final MouseWheelHandler wheelHandler = mock(MouseWheelHandler.class); final MouseMoveHandler moveHandler = mock(MouseMoveHandler.class); doReturn(domElementContainer).when(gridLienzoPanel).getDomElementContainer(); doReturn(wheelHandler).when(gridLienzoScrollHandler).disablePointerEvents(); doReturn(moveHandler).when(gridLienzoScrollHandler).enablePointerEvents(); gridLienzoScrollHandler.setupContextSwitcher(); verify(domElementContainer).addDomHandler(wheelHandler, MouseWheelEvent.getType()); verify(gridLienzoPanel).addMouseMoveHandler(moveHandler); }