/**
* Root canvas must ignore any set location invocations.
*/
public void test_root_noPosition() throws Exception {
CanvasInfo canvas =
parseJavaInfo(
"public class Test implements EntryPoint {",
" public void onModuleLoad() {",
" Canvas canvas = new Canvas();",
" canvas.setLeft('30%');",
" canvas.draw();",
" }",
"}");
canvas.refresh();
// check left position
{
Integer left = (Integer) ReflectionUtils.invokeMethod2(canvas.getObject(), "getLeft");
assertThat(left).isEqualTo(0);
}
{
Integer left = (Integer) ReflectionUtils.invokeMethod2(canvas.getObject(), "getAbsoluteLeft");
assertThat(left).isEqualTo(0);
}
//
assertThat(canvas.getAbsoluteBounds()).isEqualTo(new Rectangle(0, 0, 450, 300));
}