зеркало из https://github.com/mozilla/gecko-dev.git
*** empty log message ***
This commit is contained in:
Родитель
3c7642e902
Коммит
d850f55ddf
|
@ -73,6 +73,7 @@ function getAccessibleNode(startNode)
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
|
|
||||||
accessibleNode = accessibleService.getAccessibleFor(startNode);
|
accessibleNode = accessibleService.getAccessibleFor(startNode);
|
||||||
|
|
||||||
return accessibleNode;
|
return accessibleNode;
|
||||||
}
|
}
|
||||||
catch(e){
|
catch(e){
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Anchor Node
|
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Anchor Node
|
||||||
Author: dsirnapalli@netscape.com
|
Author: dsirnapalli@netscape.com
|
||||||
Revs: 12.13.01 - Created
|
Revs: 12.13.01 - Created
|
||||||
Last Run On:01.03.01.
|
Last Run On:01.24.02.
|
||||||
|
|
||||||
- The contents of this file are subject to the Mozilla Public
|
- The contents of this file are subject to the Mozilla Public
|
||||||
- License Version 1.1 (the "License"); you may not use this file
|
- License Version 1.1 (the "License"); you may not use this file
|
||||||
|
@ -52,68 +52,156 @@ function getDomNodeAnchor()
|
||||||
function executeTestCase()
|
function executeTestCase()
|
||||||
{
|
{
|
||||||
var domNode = getDomNodeAnchor();
|
var domNode = getDomNodeAnchor();
|
||||||
|
|
||||||
if(domNode == null)
|
if(domNode == null)
|
||||||
{
|
{
|
||||||
res = res + "Could not get the DOM Node";
|
res = res + "Could not get the DOM Node";
|
||||||
|
submitToCookie();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //else1
|
{ //else1
|
||||||
var accNode = getAccessibleNode(domNode);
|
accNode = getAccessibleNode(domNode);
|
||||||
|
tempaccNode = accNode;
|
||||||
|
|
||||||
if(accNode == "Exception")
|
if(accNode == "Exception")
|
||||||
{
|
{
|
||||||
res = res + "The Node you selected is not an Accessible Node";
|
res = res + "The Node you selected is not an Accessible Node";
|
||||||
|
submitToCookie();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //else2
|
{ //else2
|
||||||
try{
|
try{
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
|
|
||||||
var name = getName(accNode);
|
accNode.accTakeFocus();
|
||||||
var role = getRole(accNode);
|
setTimeout("constructResults();", 2000);
|
||||||
var state = getState(accNode);
|
}
|
||||||
var value = getValue(accNode);
|
catch(e){
|
||||||
|
alert("Exception**: " + e);
|
||||||
var col1 = new Array("Property", "Name->", "Role->", "State->", "Value->");
|
}
|
||||||
var col2 = new Array("Values", name, role, state, value);
|
|
||||||
var col3 = new Array("Result");
|
|
||||||
|
|
||||||
if (name == "External Link") col3[1] = "PASS"; else col3[1] = "FAIL";
|
|
||||||
if (role == "30") col3[2] = "PASS"; else col3[2] = "FAIL";
|
|
||||||
if (state == "7340096") col3[3] = "PASS"; else col3[3] = "FAIL";
|
|
||||||
if (value == "http://www.yahoo.com")
|
|
||||||
col3[4] = "PASS"; else col3[4] = "FAIL";
|
|
||||||
|
|
||||||
res += "<table border cols=3 width='70%'>";
|
|
||||||
|
|
||||||
for(i=0; i<=4; i++)
|
|
||||||
{
|
|
||||||
res += "<tr>";
|
|
||||||
res += " <td width='20%'><b>" + col1[i] + "</b></td>";
|
|
||||||
if(i==0)
|
|
||||||
res += " <td width='70%'><b>" + col2[i] + "</b></td>";
|
|
||||||
else
|
|
||||||
res += " <td>" + col2[i] + "</td>";
|
|
||||||
if (i==0)
|
|
||||||
res += " <td><b>" + col3[i] + "</b></td>";
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (col3[i] == "FAIL")
|
|
||||||
res += " <td bgcolor='#FF0000' width='10%'>" + col3[i] + "</td>";
|
|
||||||
else
|
|
||||||
res += " <td>" + col3[i] + "</td>";
|
|
||||||
}
|
|
||||||
res += "</tr>";
|
|
||||||
}
|
|
||||||
res += "</table>";
|
|
||||||
}
|
|
||||||
catch(e){
|
|
||||||
alert("Exception**: " + e);
|
|
||||||
}
|
|
||||||
}//else2
|
}//else2
|
||||||
}//else1
|
} //else1
|
||||||
|
}
|
||||||
|
|
||||||
|
function constructResults()
|
||||||
|
{
|
||||||
|
try{
|
||||||
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||||
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
|
|
||||||
|
// here we are comparing two node using accGetDOMNode() function because,
|
||||||
|
// you cant use == to compare two nodes. may be we could override == operator,
|
||||||
|
// we dont keep entire tree in memory, because that would cause bloat. when we
|
||||||
|
// need to give someone nsIAccessible we create a new one each time, but we dont
|
||||||
|
// keep trace of it, so there may be several nsIAccessible's at the same time
|
||||||
|
// in memory all representing the same part of the doc. however you can compare
|
||||||
|
// the two objs by checking their dom nodes. For users of IAccessible who dont
|
||||||
|
// have accGetDOMNode(), they can compare the unique ID value, which is
|
||||||
|
// essentially the numerical value of the dom node ptr.
|
||||||
|
if(tempaccNode.accGetDOMNode() == accNode.accFocused.accGetDOMNode())
|
||||||
|
{
|
||||||
|
varaccFocused = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
varaccFocused = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var name = getName(accNode);
|
||||||
|
var role = getRole(accNode);
|
||||||
|
var state = getState(accNode);
|
||||||
|
var value = getValue(accNode);
|
||||||
|
|
||||||
|
if (focused == true) focus = "Focused"; else focus = "Not Focused";
|
||||||
|
if (varaccFocused == true) tookfocus = "Focused"; else tookfocus = "Not Focused";
|
||||||
|
|
||||||
|
var row0 = new Array("Property", "Values", "Result");
|
||||||
|
var row1 = new Array("Name->", name);
|
||||||
|
var row2 = new Array("Role->", role);
|
||||||
|
var row3 = new Array("State->", state);
|
||||||
|
var row4 = new Array("Value->", value);
|
||||||
|
var row5 = new Array("accTakeFocus->", focus);
|
||||||
|
var row6 = new Array("accFocused->", tookfocus);
|
||||||
|
|
||||||
|
if (name == "External Link") row1[2] = "PASS"; else row1[2] = "FAIL";
|
||||||
|
if (role == "30") row2[2] = "PASS"; else row2[2] = "FAIL";
|
||||||
|
if (state == "7340100") row3[2] = "PASS"; else row3[2] = "FAIL";
|
||||||
|
if (value == "http://home.netscape.com")
|
||||||
|
row4[2] = "PASS"; else row4[2] = "FAIL";
|
||||||
|
if (focus == "Focused") row5[2] = "PASS"; else row5[2] = "FAIL";
|
||||||
|
if (tookfocus == "Focused") row6[2] = "PASS"; else row6[2] = "FAIL";
|
||||||
|
|
||||||
|
res += "<table border cols=3 width='70%'>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
res += "<td><b>" + row0[col] + "</b></td>";
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row1[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row1[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row1[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row2[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row2[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row2[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row3[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row3[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row3[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row4[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row4[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row4[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row5[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row5[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row5[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row6[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row6[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row6[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "</table>";
|
||||||
|
|
||||||
|
submitToCookie();
|
||||||
|
}
|
||||||
|
catch(e){
|
||||||
|
alert("Exception**: " + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function submitToCookie()
|
||||||
|
{
|
||||||
createCookie("nsIAccessibleTestAnchorNode", res, 14);
|
createCookie("nsIAccessibleTestAnchorNode", res, 14);
|
||||||
setTimeout("window.location.reload();", 2000);
|
setTimeout("window.location.reload();", 2000);
|
||||||
}
|
}
|
||||||
|
@ -132,13 +220,14 @@ document.write('<input name="resultsfile" type="hidden" value="' + window.opener
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
focused = false;
|
||||||
var res = "<b><u> Results for HTML Anchor Node:</u></b><br><br>";
|
var res = "<b><u> Results for HTML Anchor Node:</u></b><br><br>";
|
||||||
if(readCookie("nsIAccessibleTestAnchorNode") == null)
|
if(readCookie("nsIAccessibleTestAnchorNode") == null)
|
||||||
{
|
{
|
||||||
<!-- Test Anchor -->
|
<!-- Test Anchor -->
|
||||||
<!-- Anchor linking to external file -->
|
<!-- Anchor linking to external file -->
|
||||||
document.write('Testing Link' + '<br>');
|
document.write('Testing Link' + '<br>');
|
||||||
document.write('<a href="http://www.yahoo.com">External Link</a>');
|
document.write('<a href="http://home.netscape.com" onFocus="focused=true">External Link</a>');
|
||||||
|
|
||||||
setTimeout("executeTestCase();", 2000);
|
setTimeout("executeTestCase();", 2000);
|
||||||
}
|
}
|
||||||
|
@ -151,4 +240,5 @@ else
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Anchor Text Node
|
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Anchor Text Node
|
||||||
Author: dsirnapalli@netscape.com
|
Author: dsirnapalli@netscape.com
|
||||||
Revs: 12.13.01 - Created
|
Revs: 12.13.01 - Created
|
||||||
Last Run On:12.17.01.
|
Last Run On: 01.23.02.
|
||||||
|
|
||||||
- The contents of this file are subject to the Mozilla Public
|
- The contents of this file are subject to the Mozilla Public
|
||||||
- License Version 1.1 (the "License"); you may not use this file
|
- License Version 1.1 (the "License"); you may not use this file
|
||||||
|
@ -42,7 +42,6 @@ function getDomNodeAnchorText()
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
|
|
||||||
var node = document.getElementsByTagName("a").item(0);
|
var node = document.getElementsByTagName("a").item(0);
|
||||||
node = node.firstChild;
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
catch(e){
|
catch(e){
|
||||||
|
@ -53,68 +52,97 @@ function getDomNodeAnchorText()
|
||||||
function executeTestCase()
|
function executeTestCase()
|
||||||
{
|
{
|
||||||
var domNode = getDomNodeAnchorText();
|
var domNode = getDomNodeAnchorText();
|
||||||
if(domNode == null)
|
accNode = getAccessibleNode(domNode);
|
||||||
{
|
try{
|
||||||
res = res + "Could not get the DOM Node";
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||||
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
|
|
||||||
|
accNode.accTakeFocus();
|
||||||
|
domNode = domNode.firstChild;
|
||||||
|
accNode = getAccessibleNode(domNode);
|
||||||
|
|
||||||
|
setTimeout("constructResults();", 2000);
|
||||||
}
|
}
|
||||||
else
|
catch(e){
|
||||||
{ //else1
|
alert("Exception**: " + e);
|
||||||
var accNode = getAccessibleNode(domNode);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(accNode == "Exception")
|
function constructResults()
|
||||||
{
|
{
|
||||||
res = res + "The Node you selected is not an Accessible Node";
|
try{
|
||||||
}
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||||
else
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
{ //else2
|
|
||||||
try{
|
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
|
||||||
|
|
||||||
var name = getName(accNode);
|
var name = getName(accNode);
|
||||||
var role = getRole(accNode);
|
var role = getRole(accNode);
|
||||||
var state = getState(accNode);
|
var state = getState(accNode);
|
||||||
var value = getValue(accNode);
|
var value = getValue(accNode);
|
||||||
|
}
|
||||||
|
catch(e){
|
||||||
|
alert("Exception**: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
var col1 = new Array("Property", "Name->", "Role->", "State->", "Value->");
|
var row0 = new Array("Property", "Values", "Result");
|
||||||
var col2 = new Array("Values", name, role, state, value);
|
var row1 = new Array("Name->", name);
|
||||||
var col3 = new Array("Result");
|
var row2 = new Array("Role->", role);
|
||||||
|
var row3 = new Array("State->", state);
|
||||||
|
var row4 = new Array("Value->", value);
|
||||||
|
|
||||||
if (name == "External Link") col3[1] = "PASS"; else col3[1] = "FAIL";
|
if (name == "External Link") row1[2] = "PASS"; else row1[2] = "FAIL";
|
||||||
if (role == "42") col3[2] = "PASS"; else col3[2] = "FAIL";
|
if (role == "42") row2[2] = "PASS"; else row2[2] = "FAIL";
|
||||||
if (state == "7340096") col3[3] = "PASS"; else col3[3] = "FAIL";
|
if (state == "7340100") row3[2] = "PASS"; else row3[2] = "FAIL";
|
||||||
if (value == "http://www.yahoo.com")
|
if (value == "http://home.netscape.com")
|
||||||
col3[4] = "PASS"; else col3[4] = "FAIL";
|
row4[2] = "PASS"; else row4[2] = "FAIL";
|
||||||
|
|
||||||
res += "<table border cols=2 width='50%'>";
|
res += "<table border cols=3 width='70%'>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
res += "<td><b>" + row0[col] + "</b></td>";
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row1[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row1[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row1[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row2[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row2[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row2[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row3[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row3[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row3[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row4[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row4[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row4[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "</table>";
|
||||||
|
|
||||||
for(i=0; i<=4; i++)
|
submitToCookie();
|
||||||
{
|
}
|
||||||
res += "<tr>";
|
|
||||||
res += " <td width='20%'><b>" + col1[i] + "</b></td>";
|
|
||||||
if(i==0)
|
|
||||||
res += " <td width='70%'><b>" + col2[i] + "</b></td>";
|
|
||||||
else
|
|
||||||
res += " <td>" + col2[i] + "</td>";
|
|
||||||
if (i==0)
|
|
||||||
res += " <td><b>" + col3[i] + "</b></td>";
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (col3[i] == "FAIL")
|
|
||||||
res += " <td bgcolor='#FF0000' width='10%'>" + col3[i] + "</td>";
|
|
||||||
else
|
|
||||||
res += " <td>" + col3[i] + "</td>";
|
|
||||||
}
|
|
||||||
res += "</tr>";
|
|
||||||
}
|
|
||||||
res += "</table>";
|
|
||||||
}
|
|
||||||
catch(e){
|
|
||||||
alert("Exception**: " + e);
|
|
||||||
}
|
|
||||||
}//else2
|
|
||||||
}//else1
|
|
||||||
|
|
||||||
|
function submitToCookie()
|
||||||
|
{
|
||||||
createCookie("nsIAccessibleTestAnchorTextNode", res, 14);
|
createCookie("nsIAccessibleTestAnchorTextNode", res, 14);
|
||||||
setTimeout("window.location.reload();", 2000);
|
setTimeout("window.location.reload();", 2000);
|
||||||
}
|
}
|
||||||
|
@ -139,7 +167,7 @@ if(readCookie("nsIAccessibleTestAnchorTextNode") == null)
|
||||||
<!-- Test Anchor -->
|
<!-- Test Anchor -->
|
||||||
<!-- Anchor linking to external file -->
|
<!-- Anchor linking to external file -->
|
||||||
document.write('Testing Link' + '<br>');
|
document.write('Testing Link' + '<br>');
|
||||||
document.write('<a href="http://www.yahoo.com">External Link</a>');
|
document.write('<a href="http://home.netscape.com">External Link</a>');
|
||||||
|
|
||||||
setTimeout("executeTestCase();", 2000);
|
setTimeout("executeTestCase();", 2000);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
||||||
<html>
|
<html>
|
||||||
<title> nsIAccessible Interface Test Case </title>
|
<title> nsIAccessible Interface Test Case </title>
|
||||||
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Button
|
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Button Node
|
||||||
Author: dsirnapalli@netscape.com
|
Author: dsirnapalli@netscape.com
|
||||||
Revs: 01.08.02 - Created
|
Revs: 01.08.02 - Created
|
||||||
Last Run On:01.08.02.
|
Last Run On:01.23.02.
|
||||||
|
|
||||||
- The contents of this file are subject to the Mozilla Public
|
- The contents of this file are subject to the Mozilla Public
|
||||||
- License Version 1.1 (the "License"); you may not use this file
|
- License Version 1.1 (the "License"); you may not use this file
|
||||||
|
@ -52,70 +52,148 @@ function getDomNodeButton()
|
||||||
function executeTestCase()
|
function executeTestCase()
|
||||||
{
|
{
|
||||||
var domNode = getDomNodeButton();
|
var domNode = getDomNodeButton();
|
||||||
|
|
||||||
if(domNode == null)
|
if(domNode == null)
|
||||||
{
|
{
|
||||||
res = res + "Could not get the DOM Node";
|
res = res + "Could not get the DOM Node";
|
||||||
|
submitToCookie();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //else1
|
{ //else1
|
||||||
var accNode = getAccessibleNode(domNode);
|
accNode = getAccessibleNode(domNode);
|
||||||
|
tempaccNode = accNode;
|
||||||
|
|
||||||
if(accNode == "Exception")
|
if(accNode == "Exception")
|
||||||
{
|
{
|
||||||
res = res + "The Node you selected is not an Accessible Node";
|
res = res + "The Node you selected is not an Accessible Node";
|
||||||
|
submitToCookie();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //else2
|
{ //else2
|
||||||
try{
|
try{
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
|
|
||||||
var name = getName(accNode);
|
accNode.accTakeFocus();
|
||||||
var role = getRole(accNode);
|
setTimeout("constructResults();", 2000);
|
||||||
var state = getState(accNode);
|
}
|
||||||
var value = getValue(accNode);
|
catch(e){
|
||||||
var newvalue = value.toString();
|
alert("Exception**: " + e);
|
||||||
|
}
|
||||||
var col1 = new Array("Property", "Name->", "Role->", "State->", "Value->");
|
|
||||||
var col2 = new Array("Values", name, role, state, value);
|
|
||||||
var col3 = new Array("Result");
|
|
||||||
|
|
||||||
if (name == "Submit") col3[1] = "PASS"; else col3[1] = "FAIL";
|
|
||||||
if (role == "43") col3[2] = "PASS"; else col3[2] = "FAIL";
|
|
||||||
if (state == "1048576") col3[3] = "PASS"; else col3[3] = "FAIL";
|
|
||||||
if (newvalue.search("NS_ERROR_NOT_IMPLEMENTED"))
|
|
||||||
col3[4] = "PASS"; else col3[4] = "FAIL";
|
|
||||||
|
|
||||||
res += "<table border cols=2 width='75%'>";
|
|
||||||
|
|
||||||
for(i=0; i<=4; i++)
|
|
||||||
{
|
|
||||||
res += "<tr>";
|
|
||||||
res += " <td width='20%'><b>" + col1[i] + "</b></td>";
|
|
||||||
if(i==0)
|
|
||||||
res += " <td width='70%'><b>" + col2[i] + "</b></td>";
|
|
||||||
else
|
|
||||||
res += " <td>" + col2[i] + "</td>";
|
|
||||||
if (i==0)
|
|
||||||
res += " <td><b>" + col3[i] + "</b></td>";
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (col3[i] == "FAIL")
|
|
||||||
res += " <td bgcolor='#FF0000' width='10%'>" + col3[i] + "</td>";
|
|
||||||
else
|
|
||||||
res += " <td>" + col3[i] + "</td>";
|
|
||||||
}
|
|
||||||
res += "</tr>";
|
|
||||||
}
|
|
||||||
res += "</table>";
|
|
||||||
|
|
||||||
}
|
|
||||||
catch(e){
|
|
||||||
alert("Exception**: " + e);
|
|
||||||
}
|
|
||||||
}//else2
|
}//else2
|
||||||
}//else1
|
} //else1
|
||||||
|
}
|
||||||
|
|
||||||
|
function constructResults()
|
||||||
|
{
|
||||||
|
try{
|
||||||
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||||
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
|
|
||||||
|
if(tempaccNode.accGetDOMNode() == accNode.accFocused.accGetDOMNode())
|
||||||
|
{
|
||||||
|
varaccFocused = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
varaccFocused = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var name = getName(accNode);
|
||||||
|
var role = getRole(accNode);
|
||||||
|
var state = getState(accNode);
|
||||||
|
var value = getValue(accNode);
|
||||||
|
var newvalue = value.toString();
|
||||||
|
|
||||||
|
if (focused == true) focus = "Focused"; else focus = "Not Focused";
|
||||||
|
if (varaccFocused == true) tookfocus = "Focused"; else tookfocus = "Not Focused";
|
||||||
|
|
||||||
|
var row0 = new Array("Property", "Values", "Result");
|
||||||
|
var row1 = new Array("Name->", name);
|
||||||
|
var row2 = new Array("Role->", role);
|
||||||
|
var row3 = new Array("State->", state);
|
||||||
|
var row4 = new Array("Value->", value);
|
||||||
|
var row5 = new Array("accTakeFocus->", focus);
|
||||||
|
var row6 = new Array("accFocused->", tookfocus);
|
||||||
|
|
||||||
|
if (name == "Submit") row1[2] = "PASS"; else row1[2] = "FAIL";
|
||||||
|
if (role == "43") row2[2] = "PASS"; else row2[2] = "FAIL";
|
||||||
|
if (state == "1048580") row3[2] = "PASS"; else row3[2] = "FAIL";
|
||||||
|
if (newvalue.search("NS_ERROR_NOT_IMPLEMENTED"))
|
||||||
|
row4[2] = "PASS"; else row4[2] = "FAIL";
|
||||||
|
if (focus == "Focused") row5[2] = "PASS"; else row5[2] = "FAIL";
|
||||||
|
if (tookfocus == "Focused") row6[2] = "PASS"; else row6[2] = "FAIL";
|
||||||
|
|
||||||
|
res += "<table border cols=3 width='70%'>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
res += "<td><b>" + row0[col] + "</b></td>";
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row1[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row1[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row1[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row2[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row2[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row2[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row3[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row3[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row3[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row4[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row4[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row4[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row5[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row5[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row5[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row6[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row6[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row6[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "</table>";
|
||||||
|
|
||||||
|
submitToCookie();
|
||||||
|
}
|
||||||
|
catch(e){
|
||||||
|
alert("Exception**: " + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function submitToCookie()
|
||||||
|
{
|
||||||
createCookie("nsIAccessibleTestButtonNode", res, 14);
|
createCookie("nsIAccessibleTestButtonNode", res, 14);
|
||||||
setTimeout("window.location.reload();", 2000);
|
setTimeout("window.location.reload();", 2000);
|
||||||
}
|
}
|
||||||
|
@ -134,6 +212,7 @@ document.write('<input name="resultsfile" type="hidden" value="' + window.opener
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
focused = false;
|
||||||
var res = "<b><u> Results for HTML Button Node:</u></b><br><br>";
|
var res = "<b><u> Results for HTML Button Node:</u></b><br><br>";
|
||||||
if(readCookie("nsIAccessibleTestButtonNode") == null)
|
if(readCookie("nsIAccessibleTestButtonNode") == null)
|
||||||
{
|
{
|
||||||
|
@ -141,7 +220,7 @@ if(readCookie("nsIAccessibleTestButtonNode") == null)
|
||||||
|
|
||||||
document.write('<br>');
|
document.write('<br>');
|
||||||
document.write('Testing Button..<br><br>');
|
document.write('Testing Button..<br><br>');
|
||||||
document.write('<button value="submit"> Submit </button>');
|
document.write('<button value="submit" onFocus="focused=true"> Submit </button>');
|
||||||
|
|
||||||
setTimeout("executeTestCase();", 2000);
|
setTimeout("executeTestCase();", 2000);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
||||||
<html>
|
<html>
|
||||||
<title> nsIAccessible Interface Test Case </title>
|
<title> nsIAccessible Interface Test Case </title>
|
||||||
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Button Text
|
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Button Text Node
|
||||||
Author: dsirnapalli@netscape.com
|
Author: dsirnapalli@netscape.com
|
||||||
Revs: 01.08.02 - Created
|
Revs: 01.08.02 - Created
|
||||||
Last Run On:01.08.02.
|
Last Run On:01.23.02.
|
||||||
|
|
||||||
- The contents of this file are subject to the Mozilla Public
|
- The contents of this file are subject to the Mozilla Public
|
||||||
- License Version 1.1 (the "License"); you may not use this file
|
- License Version 1.1 (the "License"); you may not use this file
|
||||||
|
@ -42,7 +42,6 @@ function getDomNodeButtonText()
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
|
|
||||||
var node = document.getElementsByTagName("button").item(0);
|
var node = document.getElementsByTagName("button").item(0);
|
||||||
node = node.firstChild;
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
catch(e){
|
catch(e){
|
||||||
|
@ -53,70 +52,98 @@ function getDomNodeButtonText()
|
||||||
function executeTestCase()
|
function executeTestCase()
|
||||||
{
|
{
|
||||||
var domNode = getDomNodeButtonText();
|
var domNode = getDomNodeButtonText();
|
||||||
if(domNode == null)
|
accNode = getAccessibleNode(domNode);
|
||||||
{
|
try{
|
||||||
res = res + "Could not get the DOM Node";
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||||
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
|
|
||||||
|
accNode.accTakeFocus();
|
||||||
|
domNode = domNode.firstChild;
|
||||||
|
accNode = getAccessibleNode(domNode);
|
||||||
|
|
||||||
|
setTimeout("constructResults();", 2000);
|
||||||
}
|
}
|
||||||
else
|
catch(e){
|
||||||
{ //else1
|
alert("Exception**: " + e);
|
||||||
var accNode = getAccessibleNode(domNode);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(accNode == "Exception")
|
function constructResults()
|
||||||
{
|
{
|
||||||
res = res + "The Node you selected is not an Accessible Node";
|
try{
|
||||||
}
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||||
else
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
{ //else2
|
|
||||||
try{
|
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
|
||||||
|
|
||||||
var name = getName(accNode);
|
var name = getName(accNode);
|
||||||
var role = getRole(accNode);
|
var role = getRole(accNode);
|
||||||
var state = getState(accNode);
|
var state = getState(accNode);
|
||||||
var value = getValue(accNode);
|
var value = getValue(accNode);
|
||||||
var newvalue = value.toString();
|
var newvalue = value.toString();
|
||||||
|
}
|
||||||
|
catch(e){
|
||||||
|
alert("Exception**: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
var col1 = new Array("Property", "Name->", "Role->", "State->", "Value->");
|
var row0 = new Array("Property", "Values", "Result");
|
||||||
var col2 = new Array("Values", name, role, state, value);
|
var row1 = new Array("Name->", name);
|
||||||
var col3 = new Array("Result");
|
var row2 = new Array("Role->", role);
|
||||||
|
var row3 = new Array("State->", state);
|
||||||
|
var row4 = new Array("Value->", value);
|
||||||
|
|
||||||
if (name == " Submit ") col3[1] = "PASS"; else col3[1] = "FAIL";
|
if (name == " Submit ") row1[2] = "PASS"; else row1[2] = "FAIL";
|
||||||
if (role == "42") col3[2] = "PASS"; else col3[2] = "FAIL";
|
if (role == "42") row2[2] = "PASS"; else row2[2] = "FAIL";
|
||||||
if (state == "2097216") col3[3] = "PASS"; else col3[3] = "FAIL";
|
if (state == "2097216") row3[2] = "PASS"; else row3[2] = "FAIL";
|
||||||
if (newvalue.search("NS_ERROR_NOT_IMPLEMENTED"))
|
if (newvalue.search("NS_ERROR_NOT_IMPLEMENTED"))
|
||||||
col3[4] = "PASS"; else col3[4] = "FAIL";
|
row4[2] = "PASS"; else row4[2] = "FAIL";
|
||||||
alert(col3[4]);
|
|
||||||
res += "<table border cols=2 width='75%'>";
|
|
||||||
|
|
||||||
for(i=0; i<=4; i++)
|
res += "<table border cols=3 width='70%'>";
|
||||||
{
|
res += "<tr>";
|
||||||
res += "<tr>";
|
for(col=0; col<3; col++)
|
||||||
res += " <td width='20%'><b>" + col1[i] + "</b></td>";
|
res += "<td><b>" + row0[col] + "</b></td>";
|
||||||
if(i==0)
|
res += "</tr>";
|
||||||
res += " <td width='70%'><b>" + col2[i] + "</b></td>";
|
res += "<tr>";
|
||||||
else
|
for(col=0; col<3; col++)
|
||||||
res += " <td>" + col2[i] + "</td>";
|
{
|
||||||
if (i==0)
|
if(row1[col] == "FAIL")
|
||||||
res += " <td><b>" + col3[i] + "</b></td>";
|
res += "<td bgcolor='#FF0000'>" + row1[col] + "</td>";
|
||||||
else
|
else
|
||||||
{
|
res += "<td>" + row1[col] + "</td>";
|
||||||
if (col3[i] == "FAIL")
|
}
|
||||||
res += " <td bgcolor='#FF0000' width='10%'>" + col3[i] + "</td>";
|
res += "</tr>";
|
||||||
else
|
res += "<tr>";
|
||||||
res += " <td>" + col3[i] + "</td>";
|
for(col=0; col<3; col++)
|
||||||
}
|
{
|
||||||
res += "</tr>";
|
if(row2[col] == "FAIL")
|
||||||
}
|
res += "<td bgcolor='#FF0000'>" + row2[col] + "</td>";
|
||||||
res += "</table>";
|
else
|
||||||
|
res += "<td>" + row2[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row3[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row3[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row3[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "<tr>";
|
||||||
|
for(col=0; col<3; col++)
|
||||||
|
{
|
||||||
|
if(row4[col] == "FAIL")
|
||||||
|
res += "<td bgcolor='#FF0000'>" + row4[col] + "</td>";
|
||||||
|
else
|
||||||
|
res += "<td>" + row4[col] + "</td>";
|
||||||
|
}
|
||||||
|
res += "</tr>";
|
||||||
|
res += "</table>";
|
||||||
|
|
||||||
}
|
submitToCookie();
|
||||||
catch(e){
|
}
|
||||||
alert("Exception**: " + e);
|
|
||||||
}
|
|
||||||
}//else2
|
|
||||||
}//else1
|
|
||||||
|
|
||||||
|
function submitToCookie()
|
||||||
|
{
|
||||||
createCookie("nsIAccessibleTestButtonNodeText", res, 14);
|
createCookie("nsIAccessibleTestButtonNodeText", res, 14);
|
||||||
setTimeout("window.location.reload();", 2000);
|
setTimeout("window.location.reload();", 2000);
|
||||||
}
|
}
|
||||||
|
@ -135,7 +162,7 @@ document.write('<input name="resultsfile" type="hidden" value="' + window.opener
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var res = "<b><u> Results for HTML Button Node Text:</u></b><br><br>";
|
var res = "<b><u> Results for HTML Button Text Node:</u></b><br><br>";
|
||||||
if(readCookie("nsIAccessibleTestButtonNodeText") == null)
|
if(readCookie("nsIAccessibleTestButtonNodeText") == null)
|
||||||
{
|
{
|
||||||
<!-- Test Button -->
|
<!-- Test Button -->
|
||||||
|
|
Загрузка…
Ссылка в новой задаче