Search in sources :

Example 1 with AbstractImagePrototype

use of com.google.gwt.user.client.ui.AbstractImagePrototype 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 2 with AbstractImagePrototype

use of com.google.gwt.user.client.ui.AbstractImagePrototype in project gwt-test-utils by gwt-test-utils.

the class MenuBarImagesTest method getHTML.

@Test
public void getHTML() {
    // Given
    AbstractImagePrototype proto = menuBarImages.menuBarSubMenuIcon();
    // When
    String html = proto.getHTML();
    // Then
    assertThat(html).isEqualTo("<img onload='this.__gwtLastUnhandledEvent=\"load\";' src='http://127.0.0.1:8888/gwt_test_utils_module/clear.cache.gif' style='width:0.0px;height:0.0px;background:url(http://127.0.0.1:8888/gwt_test_utils_module/menuBarSubMenuIcon.gif) no-repeat 0px 0px;' border='0'>");
}
Also used : AbstractImagePrototype(com.google.gwt.user.client.ui.AbstractImagePrototype) Test(org.junit.Test)

Example 3 with AbstractImagePrototype

use of com.google.gwt.user.client.ui.AbstractImagePrototype in project gwt-test-utils by gwt-test-utils.

the class MenuBarImagesTest method checkToString.

@Test
public void checkToString() {
    // Given
    AbstractImagePrototype proto = menuBarImages.menuBarSubMenuIcon();
    // When & Then
    assertThat(proto.toString()).isNotNull();
}
Also used : AbstractImagePrototype(com.google.gwt.user.client.ui.AbstractImagePrototype) Test(org.junit.Test)

Example 4 with AbstractImagePrototype

use of com.google.gwt.user.client.ui.AbstractImagePrototype in project gwt-test-utils by gwt-test-utils.

the class MenuBarImagesTest method createElement.

@Test
public void createElement() {
    // Given
    AbstractImagePrototype proto = menuBarImages.menuBarSubMenuIcon();
    // When
    ImagePrototypeElement element = proto.createElement();
    // Then
    assertThat(element.getTagName()).isEqualTo("IMG");
    assertThat(element.toString()).isEqualTo("<img onload=\"this.__gwtLastUnhandledEvent=\"load\";\" src=\"http://127.0.0.1:8888/gwt_test_utils_module/clear.cache.gif\" style=\"width: 0px; height: 0px; background:url(http://127.0.0.1: 8888/gwt_test_utils_module/menuBarSubMenuIcon.gif) no-repeat 0px 0px; \" border=\"0\"></img>");
}
Also used : AbstractImagePrototype(com.google.gwt.user.client.ui.AbstractImagePrototype) ImagePrototypeElement(com.google.gwt.user.client.ui.AbstractImagePrototype.ImagePrototypeElement) Test(org.junit.Test)

Aggregations

AbstractImagePrototype (com.google.gwt.user.client.ui.AbstractImagePrototype)4 Test (org.junit.Test)4 ImagePrototypeElement (com.google.gwt.user.client.ui.AbstractImagePrototype.ImagePrototypeElement)1 Image (com.google.gwt.user.client.ui.Image)1