use of com.google.gwt.user.client.ui.Image in project gwt-test-utils by gwt-test-utils.
the class DOMTest method checkImageSrc.
@Test
public void checkImageSrc() {
// Given
Image img = new Image();
ImageElement elem = img.getElement().cast();
// When
DOM.setImgSrc(img.getElement(), "http://test/image.gif");
String imageSrc = DOM.getImgSrc(img.getElement());
// Then
assertThat(elem.getSrc()).isEqualTo("http://test/image.gif");
assertThat(imageSrc).isEqualTo("http://test/image.gif");
}
use of com.google.gwt.user.client.ui.Image in project gwt-test-utils by gwt-test-utils.
the class MenuBarImagesTest method createImage.
@Test
public void createImage() {
// Given
AbstractImagePrototype proto = menuBarImages.menuBarSubMenuIcon();
// When
Image image = proto.createImage();
// Then
assertThat(image.getUrl()).isEqualTo("http://127.0.0.1:8888/gwt_test_utils_module/menuBarSubMenuIcon.gif");
}
use of com.google.gwt.user.client.ui.Image in project gwt-test-utils by gwt-test-utils.
the class ImageTest method height.
@Test
public void height() {
// Given
Image i = new Image();
// When
i.setHeight("20");
// Then
assertThat(i.getHeight()).isEqualTo(20);
}
use of com.google.gwt.user.client.ui.Image in project gwt-test-utils by gwt-test-utils.
the class ImageTest method height_Px.
@Test
public void height_Px() {
// Given
Image i = new Image();
// Preconditions
assertThat(i.getHeight()).isEqualTo(0);
// When
i.setHeight("20px");
// Then
assertThat(i.getHeight()).isEqualTo(20);
}
use of com.google.gwt.user.client.ui.Image in project gwt-test-utils by gwt-test-utils.
the class ImageTest method width_Px.
@Test
public void width_Px() {
// Given
Image i = new Image();
// Preconditions
assertThat(i.getWidth()).isEqualTo(0);
// When
i.setWidth("20px");
// Then
assertThat(i.getWidth()).isEqualTo(20);
}
Aggregations