document.setAsynchronousLoadPriority(-1); // synchronous loading
pane.setText("<p>test</p>");
final int pos = document.getLength() - 1;
pane.setCaretPosition(pos);
action.actionPerformed(new ActionEvent(pane, 0, null));
Element e = document.getCharacterElement(pos + 1);
assertEquals(HTML.Tag.HR, getHTMLTagByElement(e));
assertNotNull(e);
HTML.Tag parentTag = getHTMLTagByElement(e.getParentElement());
assertTrue(HTML.Tag.P.equals(parentTag) || HTML.Tag.IMPLIED.equals(parentTag));