gecko/accessible/tests/mochitest/name.js
Alexander Surkov d56619b51b Bug 613131 - role nothing should allow recursive name calculation from children, r=fer, davidb, marcoz, a=davidb
--HG--
rename : accessible/tests/mochitest/name.css => accessible/tests/mochitest/name/general.css
rename : accessible/tests/mochitest/name.xbl => accessible/tests/mochitest/name/general.xbl
rename : accessible/tests/mochitest/name.js => accessible/tests/mochitest/name/markup.js
rename : accessible/tests/mochitest/namerules.xml => accessible/tests/mochitest/name/markuprules.xml
rename : accessible/tests/mochitest/name_nsRootAcc_wnd.xul => accessible/tests/mochitest/name/nsRootAcc_wnd.xul
rename : accessible/tests/mochitest/test_name_button.html => accessible/tests/mochitest/name/test_button.html
rename : accessible/tests/mochitest/test_name.html => accessible/tests/mochitest/name/test_general.html
rename : accessible/tests/mochitest/test_name.xul => accessible/tests/mochitest/name/test_general.xul
rename : accessible/tests/mochitest/test_name_link.html => accessible/tests/mochitest/name/test_link.html
rename : accessible/tests/mochitest/test_name_markup.html => accessible/tests/mochitest/name/test_markup.html
rename : accessible/tests/mochitest/test_name_nsRootAcc.xul => accessible/tests/mochitest/name/test_nsRootAcc.xul
2010-11-21 09:02:16 +08:00

20 lines
446 B
JavaScript

/**
* Test accessible name for the given accessible identifier.
*/
function testName(aAccOrElmOrID, aName, aMsg)
{
var msg = aMsg ? aMsg : "";
var acc = getAccessible(aAccOrElmOrID);
if (!acc)
return;
var txtID = prettyName(aAccOrElmOrID);
try {
is(acc.name, aName, msg + "Wrong name of the accessible for " + txtID);
} catch (e) {
ok(false, msg + "Can't get name of the accessible for " + txtID);
}
return acc;
}