コード例 #1
0
ファイル: DialogBoxTest.java プロジェクト: JoachimKurz/gwt
  public void testDebugId() {
    DialogBox dBox = new DialogBox();
    dBox.setAnimationEnabled(false);
    dBox.ensureDebugId("myDialogBox");
    dBox.setText("test caption");
    Label content = new Label("content");
    dBox.setWidget(content);
    dBox.show();

    // Check the body ids
    UIObjectTest.assertDebugId("myDialogBox", dBox.getElement());
    UIObjectTest.assertDebugId("myDialogBox-content", DOM.getParent(content.getElement()));

    delayTestFinish(5000);
    // Check the header IDs
    Scheduler.get()
        .scheduleDeferred(
            new ScheduledCommand() {
              public void execute() {
                UIObjectTest.assertDebugIdContents("myDialogBox-caption", "test caption");
                finishTest();
              }
            });
  }