Search in sources :

Example 31 with WMenuItem

use of com.github.bordertech.wcomponents.WMenuItem in project wcomponents by BorderTech.

the class WMenuRenderer_Test method testXssEscaping.

@Test
public void testXssEscaping() throws IOException, SAXException, XpathException {
    WMenu menu = new WMenu();
    menu.add(new WMenuItem("test"));
    assertSafeContent(menu);
    menu.setToolTip(getMaliciousAttribute());
    assertSafeContent(menu);
    menu.setAccessibleText(getMaliciousAttribute());
    assertSafeContent(menu);
}
Also used : WMenuItem(com.github.bordertech.wcomponents.WMenuItem) WMenu(com.github.bordertech.wcomponents.WMenu) Test(org.junit.Test)

Aggregations

WMenuItem (com.github.bordertech.wcomponents.WMenuItem)31 WMenu (com.github.bordertech.wcomponents.WMenu)23 Test (org.junit.Test)16 WSubMenu (com.github.bordertech.wcomponents.WSubMenu)11 WDecoratedLabel (com.github.bordertech.wcomponents.WDecoratedLabel)5 WText (com.github.bordertech.wcomponents.WText)5 Action (com.github.bordertech.wcomponents.Action)4 ActionEvent (com.github.bordertech.wcomponents.ActionEvent)4 WImage (com.github.bordertech.wcomponents.WImage)4 WMenuItemGroup (com.github.bordertech.wcomponents.WMenuItemGroup)4 TreeNode (com.github.bordertech.wcomponents.util.TreeNode)2 Margin (com.github.bordertech.wcomponents.Margin)1 Request (com.github.bordertech.wcomponents.Request)1 TestAction (com.github.bordertech.wcomponents.TestAction)1 WAjaxControl (com.github.bordertech.wcomponents.WAjaxControl)1 WButton (com.github.bordertech.wcomponents.WButton)1 WContainer (com.github.bordertech.wcomponents.WContainer)1 WContent (com.github.bordertech.wcomponents.WContent)1 WContentLink (com.github.bordertech.wcomponents.WContentLink)1 WPanel (com.github.bordertech.wcomponents.WPanel)1