container.refresh();
ComponentInfo button = (ComponentInfo) container.getWidgets().get(0);
MenuInfo menu = button.getChildren(MenuInfo.class).get(0);
assertFalse(menu.isSubMenu());
// IMenuPopupInfo
IMenuPopupInfo popupObject = MenuObjectInfoUtils.getMenuPopupInfo(menu);
assertSame(menu, popupObject.getModel());
// presentation
{
// use icon as "popup" image
{
Image image = popupObject.getImage();
assertSame(menu.getDescription().getIcon(), image);
}
// some reasonable bounds
{
Rectangle bounds = popupObject.getBounds();
assertThat(bounds.width).isEqualTo(16);
assertThat(bounds.height).isEqualTo(16);
}
}
// access
{
IMenuInfo menuObject = popupObject.getMenu();
assertSame(MenuObjectInfoUtils.getMenuInfo(menu), menuObject);
assertSame(menuObject, menuObject.getModel());
}
assertNotNull(popupObject.getPolicy());
}