import java.util.Set;
import java.util.logging.Logger;
+import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.ComponentConnector;
import com.vaadin.client.ConnectorHierarchyChangeEvent;
registerRpc(GridClientRpc.class, new GridClientRpc() {
@Override
public void scrollToStart() {
- getWidget().scrollToStart();
+ Scheduler.get().scheduleFinally(new ScheduledCommand() {
+ @Override
+ public void execute() {
+ getWidget().scrollToStart();
+ }
+ });
}
@Override
public void scrollToEnd() {
- getWidget().scrollToEnd();
+ Scheduler.get().scheduleFinally(new ScheduledCommand() {
+ @Override
+ public void execute() {
+ getWidget().scrollToEnd();
+ }
+ });
}
@Override
- public void scrollToRow(int row, ScrollDestination destination) {
- getWidget().scrollToRow(row, destination);
+ public void scrollToRow(final int row,
+ final ScrollDestination destination) {
+ Scheduler.get().scheduleFinally(new ScheduledCommand() {
+ @Override
+ public void execute() {
+ getWidget().scrollToRow(row, destination);
+ }
+ });
}
});
import com.vaadin.testbench.elements.GridElement;
import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.testbench.elements.NotificationElement;
import com.vaadin.tests.annotations.TestCategory;
import com.vaadin.tests.tb3.MultiBrowserTest;
public class GridSingleColumnTest extends MultiBrowserTest {
@Test
- public void headerIsVisible() {
+ public void testHeaderIsVisible() {
openTestURL();
GridCellElement cell = $(GridElement.class).first().getHeaderCell(0, 0);
Assert.assertTrue("No header available", cell.getText()
.equalsIgnoreCase("header"));
}
+
+ @Test
+ public void testScrollDidNotThrow() {
+ setDebug(true);
+ openTestURL();
+
+ Assert.assertFalse("Exception when scrolling on init",
+ isElementPresent(NotificationElement.class));
+ }
}