public void testIconAccessors() {
loadApi(new Runnable() {
public void run() {
Icon ic = Icon.newInstance();
Point pointA = Point.newInstance(10, 20);
ic.setDragCrossAnchor(pointA);
assertEquals("DragCrossAnchor", pointA, ic.getDragCrossAnchor());
String dragCrossImage = "DragCrossImage";
ic.setDragCrossImageURL(dragCrossImage);
assertEquals("DragCrossImageURL", dragCrossImage,
ic.getDragCrossImageUrl());
Size size1 = Size.newInstance(20, 20);
ic.setDragCrossSize(size1);
assertEquals("DragCrossSize", size1, ic.getDragCrossSize());
Point pointB = Point.newInstance(20, 30);
ic.setIconAnchor(pointB);
assertEquals("IconAnchor", pointB, ic.getIconAnchor());
Size size2 = Size.newInstance(2, 2);
ic.setIconSize(size2);
assertEquals("IconSize", size2, ic.getIconSize());
int[] map1 = {1, 2, 3, 4};
ic.setImageMap(map1);
assertEquals("ImageMap length", map1.length, ic.getImageMap().length());
for (int i = 0; i < map1.length; i++) {
assertEquals("ImageMap", map1[i], ic.getImageMapArray()[i]);
}
JsArrayInteger map2 = JavaScriptObject.createArray().cast();
map2.set(0, 4);
map2.set(1, 5);
map2.set(2, 6);
map2.set(3, 7);
ic.setImageMap(map2);
for (int i = 0; i < map2.length(); i++) {
assertEquals("ImageMap", map2.get(i), ic.getImageMap().get(i));
}
String dummyImage = "DummyImage";
ic.setImageURL(dummyImage);
assertEquals("ImageURL", dummyImage, ic.getImageURL());
Point pointC = Point.newInstance(100, 20);
ic.setInfoWindowAnchor(pointC);
assertEquals("InfoWindowAnchor", pointC, ic.getInfoWindowAnchor());
ic.setMaxHeight(10);
assertEquals("MaxHeight", 10, ic.getMaxHeight());