2008-07-02 10:09:53 -07:00
|
|
|
function testValue(aID, aAcc, aValue, aRole)
|
|
|
|
{
|
2012-04-09 02:48:41 -07:00
|
|
|
is(aAcc.value, aValue, "Wrong value for " + aID + "!");
|
2008-07-02 10:09:53 -07:00
|
|
|
}
|
|
|
|
|
2012-05-26 08:47:22 -07:00
|
|
|
function testAction(aID, aAcc, aActionCount, aActionName, aActionDescription)
|
2008-07-02 10:09:53 -07:00
|
|
|
{
|
2012-05-26 08:47:22 -07:00
|
|
|
var actionCount = aAcc.actionCount;
|
|
|
|
is(actionCount, aActionCount, "Wrong number of actions for " + aID + "!");
|
2008-07-02 10:09:53 -07:00
|
|
|
|
2012-05-26 08:47:22 -07:00
|
|
|
if (actionCount != 0) {
|
2008-07-02 10:09:53 -07:00
|
|
|
// Test first action. Normally only 1 should be present.
|
|
|
|
is(aAcc.getActionName(0), aActionName,
|
|
|
|
"Wrong name of action for " + aID + "!");
|
|
|
|
is(aAcc.getActionDescription(0), aActionDescription,
|
|
|
|
"Wrong description of action for " + aID + "!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-14 10:48:01 -07:00
|
|
|
function testThis(aID, aName, aValue, aDescription, aRole,
|
2012-05-26 08:47:22 -07:00
|
|
|
aActionCount, aActionName, aActionDescription)
|
2008-07-02 10:09:53 -07:00
|
|
|
{
|
2009-01-06 06:04:28 -08:00
|
|
|
var acc = getAccessible(aID);
|
|
|
|
if (!acc)
|
|
|
|
return;
|
2008-07-02 10:09:53 -07:00
|
|
|
|
2009-01-06 06:04:28 -08:00
|
|
|
is(acc.name, aName, "Wrong name for " + aID + "!");
|
|
|
|
testValue(aID, acc, aValue, aRole);
|
|
|
|
is(acc.description, aDescription, "Wrong description for " + aID + "!");
|
2009-03-07 03:23:25 -08:00
|
|
|
testRole(aID, aRole);
|
2008-07-02 10:09:53 -07:00
|
|
|
|
2012-05-26 08:47:22 -07:00
|
|
|
testAction(aID, acc, aActionCount, aActionName, aActionDescription);
|
2008-07-02 10:09:53 -07:00
|
|
|
}
|