}
@DisposeProjectAfter
public void test_reparseOnCss_andDontHurtCoordinates() throws Exception {
dontUseSharedGWTState();
ComplexPanelInfo panel =
parseJavaInfo(
"// filler filler filler filler filler",
"public class Test extends AbsolutePanel {",
" public Test() {",
" setStyleName('test');",
" }",
"}");
refresh();
// update CSS
setFileContent(
"war/Module.css",
getSourceDQ(
"/* filler filler filler filler filler */",
"/* filler filler filler filler filler */",
"/* filler filler filler filler filler */",
".test {",
" border: red 10px solid;",
"}"));
waitForAutoBuild();
// now refresh required
{
EditorActivatedRequest request = new EditorActivatedRequest();
panel.getBroadcast(EditorActivatedListener.class).invoke(request);
assertFalse(request.isReparseRequested());
assertTrue(request.isRefreshRequested());
}
// do refresh, as requested
refresh();
// assert that screen shot is correct and border is fully included
{
Image image = panel.getImage();
int width = image.getBounds().width;
int height = image.getBounds().height;
assertRGB(getPixelRGB(image, 0, 0), 0xFF, 0, 0);
assertRGB(getPixelRGB(image, width - 1, 0), 0xFF, 0, 0);
assertRGB(getPixelRGB(image, 0, height - 1), 0xFF, 0, 0);