2010-11-20 17:02:16 -08:00
|
|
|
/**
|
|
|
|
* Test accessible name for the given accessible identifier.
|
|
|
|
*/
|
2009-02-15 00:29:45 -08:00
|
|
|
function testName(aAccOrElmOrID, aName, aMsg)
|
|
|
|
{
|
|
|
|
var msg = aMsg ? aMsg : "";
|
|
|
|
|
|
|
|
var acc = getAccessible(aAccOrElmOrID);
|
2009-02-18 23:06:14 -08:00
|
|
|
if (!acc)
|
|
|
|
return;
|
2009-02-15 00:29:45 -08:00
|
|
|
|
2009-05-12 22:13:12 -07:00
|
|
|
var txtID = prettyName(aAccOrElmOrID);
|
2009-02-15 00:29:45 -08:00
|
|
|
try {
|
2009-05-12 22:13:12 -07:00
|
|
|
is(acc.name, aName, msg + "Wrong name of the accessible for " + txtID);
|
2009-02-15 00:29:45 -08:00
|
|
|
} catch (e) {
|
2009-05-12 22:13:12 -07:00
|
|
|
ok(false, msg + "Can't get name of the accessible for " + txtID);
|
2009-02-15 00:29:45 -08:00
|
|
|
}
|
|
|
|
return acc;
|
|
|
|
}
|
2012-12-31 00:04:08 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Test accessible description for the given accessible.
|
|
|
|
*/
|
|
|
|
function testDescr(aAccOrElmOrID, aDescr)
|
|
|
|
{
|
|
|
|
var acc = getAccessible(aAccOrElmOrID);
|
|
|
|
if (!acc)
|
|
|
|
return;
|
|
|
|
|
|
|
|
is(acc.description, aDescr,
|
|
|
|
"Wrong description for " + prettyName(aAccOrElmOrID));
|
|
|
|
}
|