/** Test getters and setters for the caption. */ public void testCaption() { DialogBox dialogBox = new DialogBox(); // Set the caption as text dialogBox.setText("text"); assertEquals("text", dialogBox.getText()); dialogBox.setText("<b>text</b>"); assertEquals("<b>text</b>", dialogBox.getText()); // Set the caption as html dialogBox.setHTML("text"); assertEquals("text", dialogBox.getText()); assertEquals("text", dialogBox.getHTML()); dialogBox.setHTML("<b>text</b>"); assertEquals("text", dialogBox.getText()); assertTrue(dialogBox.getHTML().equalsIgnoreCase("<b>text</b>")); }
public void testSafeHtmlConstructor() { DialogBox box = new DialogBox(); box.setHTML(SafeHtmlUtils.fromSafeConstant(html)); assertEquals(html, box.getHTML().toLowerCase()); }