Search in sources :

Example 6 with Image

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");
}
Also used : Image(com.google.gwt.user.client.ui.Image) GwtTestTest(com.googlecode.gwt.test.GwtTestTest) Test(org.junit.Test)

Example 7 with Image

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");
}
Also used : AbstractImagePrototype(com.google.gwt.user.client.ui.AbstractImagePrototype) Image(com.google.gwt.user.client.ui.Image) Test(org.junit.Test)

Example 8 with Image

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);
}
Also used : Image(com.google.gwt.user.client.ui.Image) Test(org.junit.Test)

Example 9 with Image

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);
}
Also used : Image(com.google.gwt.user.client.ui.Image) Test(org.junit.Test)

Example 10 with Image

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);
}
Also used : Image(com.google.gwt.user.client.ui.Image) Test(org.junit.Test)

Aggregations

Image (com.google.gwt.user.client.ui.Image)52 Test (org.junit.Test)13 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)9 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)9 Element (com.google.gwt.dom.client.Element)8 Label (com.google.gwt.user.client.ui.Label)8 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)7 ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)7 ImageResource (com.google.gwt.resources.client.ImageResource)6 FlexTable (com.google.gwt.user.client.ui.FlexTable)5 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)5 HTML (com.google.gwt.user.client.ui.HTML)5 Style (com.google.gwt.dom.client.Style)4 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)4 Anchor (com.google.gwt.user.client.ui.Anchor)4 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)4 FlexCellFormatter (com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)3 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)3 HighlightingInlineHyperlink (com.google.gerrit.client.ui.HighlightingInlineHyperlink)2 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)2