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;
|
|
|
|
}
|