Library file.Contains methods useful for all the testcases.

This commit is contained in:
dsirnapalli%netscape.com 2002-03-06 02:07:40 +00:00
parent c68e672348
commit 0f892551ce
17 changed files with 2907 additions and 3295 deletions

View File

@ -0,0 +1,195 @@
//********************* Cookie functions **********************************
function createCookie(name,value,days)
{
if (days)
{
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name)
{
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++)
{
var c = ca[i];
while (c.charAt(0)==' ')
c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
function eraseCookie(name)
{
createCookie(name,"",-1);
}
function submitToCookie()
{
createCookie(cookieName, res, 14);
setTimeout("window.location.reload();", 2000);
}
//********************* End of cookie functions ****************************
//********************* General Functions ****************************
function displayResults(results)
{
document.results.textarea.value = results;
if (top.name == "testWindow")
{
fixSubmit();
}
else
{
document.write(document.results.textarea.value);
}
}
// This function is called if accessible node gets the focus. When accessible node gets focus
// there is an focus event on button which gets fired and calls this function.
function nodeFocused()
{
nodeFocus = "Focused";
}
function appendTableRes()
{
res += "<table border cols=4 width='70%'>";
for(var i=0; i<row.length; i++)
{
temprow = new Array();
res += "<tr>";
temprow = row[i];
if(i==0)
{
for(var j=0; j<temprow.length; j++)
res += "<td><b>" + temprow[j] + "</b></td>";
}
else
{
for(var j=0; j<temprow.length; j++)
{
if(temprow[j] == "FAIL")
res += "<td bgcolor='#FF0000'>" + temprow[j] + "</b>";
else
res += "<td>" + temprow[j] + "</b>";
}
}
res += "</tr>";
}
res += "</table>";
}
//********************* End of General functions ****************************
//************** functions for nsIAccessibleService interface ***************
function getAccessibleNode(startNode)
{
var accessibleService = null;
var accessibleNode = null;
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
accessibleService = Components.classes["@mozilla.org/accessibilityService;1"].createInstance();
accessibleService = accessibleService.QueryInterface(Components.interfaces.nsIAccessibilityService);
}
catch(e){
alert("Error getting accessibility service");
}
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
accessibleNode = accessibleService.getAccessibleFor(startNode);
return accessibleNode;
}
catch(e){
return "Exception";
}
}
//************** End of functions for nsIAccessibleService interface ***********
//**************** functions of nsIAccessible Interface ************************
// This function will test the attribute accName.
function getName()
{
try{
return accNode.accName;
}
catch(e){
return(e);
}
}
// This function will test the attribute accRole.
function getRole()
{
try{
return accNode.accRole;
}
catch(e){
return(e);
}
}
// This function will test the attribute accState.
function getState()
{
try{
return accNode.accState;
}
catch(e){
return(e);
}
}
// This function will test the attribute accValue.
function getValue()
{
try{
return accNode.accValue;
}
catch(e){
return(e);
}
}
// This function will test the attribute accNumActions.
function getNumActions()
{
try{
return accNode.accNumActions;
}
catch(e){
return(e);
}
}
// This function will test the method getAccActionName.
function getActionName()
{
try{
return accNode.getAccActionName(0);
}
catch(e){
return(e);
}
}
// This function will test the method accDoAction.
function doAction()
{
try{
accNode.accDoAction(0);
}
catch(e){
return(e);
}
}
//****************** End of functions of nsIAccessible Interface *************

View File

@ -1,250 +1,194 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Anchor Node
Author: dsirnapalli@netscape.com
Revs: 12.13.01 - Created
Last Run On:01.30.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accessibility.js"></script>
<script type="text/javascript">
function getDomNodeAnchor()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("a").item(0);
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeAnchor();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{ //else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{ //else2
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
accNode.accTakeFocus();
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}//else2
} //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 expectedName = "External Link";
var expectedRole = "30";
var expectedState = "7340100";
var expectedValue = "http://home.netscape.com";
var expectedFocus = "Focused";
var expectedTookfocus = "Focused";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
var row5 = new Array("accTakeFocus->", expectedFocus, focus);
var row6 = new Array("accFocused->", expectedTookfocus, tookfocus);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (value == expectedValue) row4[3] = "PASS"; else row4[3] = "FAIL";
if (focus == expectedFocus) row5[3] = "PASS"; else row5[3] = "FAIL";
if (tookfocus == expectedTookfocus) row6[3] = "PASS"; else row6[3] = "FAIL";
res += "<table border cols=4 width='70%'>";
res += "<tr>";
for(col=0; col<4; col++)
res += "<td><b>" + row0[col] + "</b></td>";
res += "</tr>";
res += "<tr>";
for(col=0; col<4; 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<4; 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<4; 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<4; 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<4; 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<4; 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);
setTimeout("window.location.reload();", 2000);
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
focused = false;
var res = "<b><u> Results for HTML Anchor Node:</u></b><br><br>";
if(readCookie("nsIAccessibleTestAnchorNode") == null)
{
<!-- Test Anchor -->
<!-- Anchor linking to external file -->
document.write('Testing Link' + '<br>');
document.write('<a href="http://home.netscape.com" onFocus="focused=true">External Link</a>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie("nsIAccessibleTestAnchorNode");
eraseCookie("nsIAccessibleTestAnchorNode");
displayResults(cookieValue);
}
</script>
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
for HTML Anchor Node
Author: dsirnapalli@netscape.com
Revs: 01.13.02 - Created
Last Run On:02.21.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accesslib.js"></script>
<script type="text/javascript">
function getDomNodeAnchor()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("a").item(0);
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeAnchor();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{//else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// Here we are telling the accessible node to get focus.We had to call constructResults
// after some time interval because it actually takes some time for the accessible
// node to get focus. Before checking pass fail criteria in constructResults method
// we had to give some time for the node to get focus.
accNode.accTakeFocus();
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}//else2
}
}
function constructResults()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// originally we stored the accNode in tempaccNode.
// Below code is used to check where the focus actually is.
// accNode.accFocused returns an accessible node. on that accessible node when you call
// accGetDOMNode it will return the corresponding dom node. if that dom node and
// tempaccNode's dom node is same, that mean focus is on the node we expected it to be on.
if(tempaccNode.accGetDOMNode() == accNode.accFocused.accGetDOMNode())
{
varaccFocused = "Focused";
}
else
{
varaccFocused = "Not Focused";
}
var name = getName();
var role = getRole();
var state = getState();
var value = getValue();
var newvalue = value.toString();
var numActions = getNumActions();
if(numActions > 1)
alert("When i last modified the test case numActions was 1. Now numActions is more than 1. Add tests for other numActions");
var actionName = getActionName();
var expectedName = "External Link";
var expectedRole = "30";
var expectedState = "7340100";
var expectedValue = "http://home.netscape.com";
var expectednodeFocus = "Focused";
var expectedaccFocused = "Focused";
var expectednumActions = "1";
var expectedactionName = "Jump";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
var row5 = new Array("accTakeFocus()->", expectednodeFocus, nodeFocus);
var row6 = new Array("accFocused->", expectedaccFocused, varaccFocused);
var row7 = new Array("accNumActions->", expectednumActions, numActions);
var row8 = new Array("getAccActionName()->", expectedactionName, actionName);
row = new Array(row0, row1, row2, row3, row4, row5, row6, row7, row8);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.match(expectedValue)) row4[3] = "PASS"; else row4[3] = "FAIL";
if (nodeFocus == expectednodeFocus) row5[3] = "PASS"; else row5[3] = "FAIL";
if (varaccFocused == expectedaccFocused) row6[3] = "PASS"; else row6[3] = "FAIL";
if (numActions == expectednumActions) row7[3] = "PASS"; else row7[3] = "FAIL";
if (actionName == expectedactionName) row8[3] = "PASS"; else row8[3] = "FAIL";
appendTableRes();
submitToCookie();
}
catch(e){
alert("Exception**: " + e);
}
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
nodeFocus = "Not Focused";
cookieName = "nsIAccessibleTestAnchorNode";
var res = "<b><u> Results for HTML Anchor Node:</u></b><br><br>";
if(readCookie(cookieName) == null)
{
<!-- Test Anchor -->
<!-- Anchor linking to external file -->
document.write('Testing Link' + '<br>');
document.write('<a href="http://home.netscape.com" onFocus="nodeFocused();">External Link</a>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie(cookieName);
eraseCookie(cookieName);
displayResults(cookieValue);
}
</script>
</body>
</html>

View File

@ -1,187 +1,144 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Anchor Text Node
Author: dsirnapalli@netscape.com
Revs: 12.13.01 - Created
Last Run On: 01.23.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accessibility.js"></script>
<script type="text/javascript">
function getDomNodeAnchorText()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("a").item(0);
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeAnchorText();
accNode = getAccessibleNode(domNode);
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
accNode.accTakeFocus();
domNode = domNode.firstChild;
accNode = getAccessibleNode(domNode);
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}
function constructResults()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var name = getName(accNode);
var role = getRole(accNode);
var state = getState(accNode);
var value = getValue(accNode);
}
catch(e){
alert("Exception**: " + e);
}
var expectedName = "External Link";
var expectedRole = "42";
var expectedState = "7340100";
var expectedValue = "http://home.netscape.com";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (value == expectedValue) row4[3] = "PASS"; else row4[3] = "FAIL";
res += "<table border cols=4 width='70%'>";
res += "<tr>";
for(col=0; col<4; col++)
res += "<td><b>" + row0[col] + "</b></td>";
res += "</tr>";
res += "<tr>";
for(col=0; col<4; 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<4; 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<4; 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<4; col++)
{
if(row4[col] == "FAIL")
res += "<td bgcolor='#FF0000'>" + row4[col] + "</td>";
else
res += "<td>" + row4[col] + "</td>";
}
res += "</tr>";
res += "</table>";
submitToCookie();
}
function submitToCookie()
{
createCookie("nsIAccessibleTestAnchorTextNode", res, 14);
setTimeout("window.location.reload();", 2000);
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
var res = "<b><u> Results for HTML Anchor Text Node:</u></b><br><br>";
if(readCookie("nsIAccessibleTestAnchorTextNode") == null)
{
<!-- Test Anchor -->
<!-- Anchor linking to external file -->
document.write('Testing Link' + '<br>');
document.write('<a href="http://home.netscape.com">External Link</a>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie("nsIAccessibleTestAnchorTextNode");
eraseCookie("nsIAccessibleTestAnchorTextNode");
displayResults(cookieValue);
}
</script>
</body>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
for HTML Anchor Text Node
Author: dsirnapalli@netscape.com
Revs: 01.13.02 - Created
Last Run On: 02.21.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accesslib.js"></script>
<script type="text/javascript">
function getDomNodeAnchorText()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("a").item(0);
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeAnchorText();
accNode = getAccessibleNode(domNode);
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
accNode.accTakeFocus();
domNode = domNode.firstChild;
accNode = getAccessibleNode(domNode);
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}
function constructResults()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var name = getName();
var role = getRole();
var state = getState();
var value = getValue();
var newvalue = value.toString();
var expectedName = "External Link";
var expectedRole = "42";
var expectedState = "7340100";
var expectedValue = "http://home.netscape.com";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
row = new Array(row0, row1, row2, row3, row4);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.match(expectedValue)) row4[3] = "PASS"; else row4[3] = "FAIL";
appendTableRes();
submitToCookie();
}
catch(e){
alert("Exception**: " + e);
}
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
cookieName = "nsIAccessibleTestAnchorTextNode";
var res = "<b><u> Results for HTML Anchor Text Node:</u></b><br><br>";
if(readCookie(cookieName) == null)
{
<!-- Test Anchor -->
<!-- Anchor linking to external file -->
document.write('Testing Link' + '<br>');
document.write('<a href="http://home.netscape.com">External Link</a>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie(cookieName);
eraseCookie(cookieName);
displayResults(cookieValue);
}
</script>
</body>
</html>

View File

@ -1,243 +1,203 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Button Node
Author: dsirnapalli@netscape.com
Revs: 01.08.02 - Created
Last Run On:01.23.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accessibility.js"></script>
<script type="text/javascript">
function getDomNodeButton()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("button").item(0);
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeButton();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{ //else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{ //else2
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
accNode.accTakeFocus();
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}//else2
} //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 expectedName = "Submit";
var expectedRole = "43";
var expectedState = "1048580";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var expectedFocus = "Focused";
var expectedTookfocus = "Focused";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
var row5 = new Array("accTakeFocus->", expectedFocus, focus);
var row6 = new Array("accFocused->", expectedTookfocus, tookfocus);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.search("NS_ERROR_NOT_IMPLEMENTED"))
row4[3] = "PASS"; else row4[3] = "FAIL";
if (focus == expectedFocus) row5[3] = "PASS"; else row5[3] = "FAIL";
if (tookfocus == expectedTookfocus) row6[3] = "PASS"; else row6[3] = "FAIL";
res += "<table border cols=4 width='70%'>";
res += "<tr>";
for(col=0; col<4; col++)
res += "<td><b>" + row0[col] + "</b></td>";
res += "</tr>";
res += "<tr>";
for(col=0; col<4; 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<4; 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<4; 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<4; 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<4; 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<4; 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);
setTimeout("window.location.reload();", 2000);
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
focused = false;
var res = "<b><u> Results for HTML Button Node:</u></b><br><br>";
if(readCookie("nsIAccessibleTestButtonNode") == null)
{
<!-- Test Button -->
document.write('<br>');
document.write('Testing Button..<br><br>');
document.write('<button value="submit" onFocus="focused=true"> Submit </button>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie("nsIAccessibleTestButtonNode");
eraseCookie("nsIAccessibleTestButtonNode");
displayResults(cookieValue);
}
</script>
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
for HTML Button Node
Author: dsirnapalli@netscape.com
Revs: 01.08.02 - Created
Last Run On:02.21.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accesslib.js"></script>
<script type="text/javascript">
function getDomNodeButton()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("button").item(0);
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeButton();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{//else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// Here we are telling the accessible node to get focus.We had to call constructResults
// after some time interval because it actually takes some time for the accessible
// node to get focus. Before checking pass fail criteria in constructResults method
// we had to give some time for the node to get focus.
accNode.accTakeFocus();
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}//else2
}
}
function nodeClicked()
{
nodeClick = "Button Pressed";
}
function constructResults()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// originally we stored the accNode in tempaccNode.
// Below code is used to check where the focus actually is.
// accNode.accFocused returns an accessible node. on that accessible node when you call
// accGetDOMNode it will return the corresponding dom node. if that dom node and
// tempaccNode's dom node is same, that mean focus is on the node we expected it to be on.
if(tempaccNode.accGetDOMNode() == accNode.accFocused.accGetDOMNode())
{
varaccFocused = "Focused";
}
else
{
varaccFocused = "Not Focused";
}
var name = getName();
var role = getRole();
var state = getState();
var value = getValue();
var newvalue = value.toString();
var numActions = getNumActions();
if(numActions > 1)
alert("When i last modified the test case numActions was 1. Now numActions is more than 1. Add tests for other numActions");
var actionName = getActionName();
var action = doAction();
var expectedName = "Submit";
var expectedRole = "43";
var expectedState = "1048580";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var expectednodeFocus = "Focused";
var expectedaccFocused = "Focused";
var expectednumActions = "1";
var expectedactionName = "Press";
var expectednodeClick = "Button Pressed";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
var row5 = new Array("accTakeFocus()->", expectednodeFocus, nodeFocus);
var row6 = new Array("accFocused->", expectedaccFocused, varaccFocused);
var row7 = new Array("accNumActions->", expectednumActions, numActions);
var row8 = new Array("getAccActionName()->", expectedactionName, actionName);
var row9 = new Array("accDoAction()->", expectednodeClick, nodeClick);
row = new Array(row0, row1, row2, row3, row4, row5, row6, row7, row8, row9);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.match(expectedValue)) row4[3] = "PASS"; else row4[3] = "FAIL";
if (nodeFocus == expectednodeFocus) row5[3] = "PASS"; else row5[3] = "FAIL";
if (varaccFocused == expectedaccFocused) row6[3] = "PASS"; else row6[3] = "FAIL";
if (numActions == expectednumActions) row7[3] = "PASS"; else row7[3] = "FAIL";
if (actionName == expectedactionName) row8[3] = "PASS"; else row8[3] = "FAIL";
if (nodeClick == expectednodeClick) row9[3] = "PASS"; else row9[3] = "FAIL";
appendTableRes();
submitToCookie();
}
catch(e){
alert("Exception**: " + e);
}
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
nodeFocus = "Not Focused";
nodeClick = "Button Not Pressed";
cookieName = "nsIAccessibleTestButtonNode";
res = "<b><u> Results for HTML Button Node:</u></b><br><br>";
if(readCookie(cookieName) == null)
{
<!-- Test Button -->
document.write('<br>');
document.write('<b>Testing Button for Accessibility..</b><br><br>');
document.write('<button value="submit" onClick="nodeClicked();" onFocus="nodeFocused();"> Submit </button>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie(cookieName);
eraseCookie(cookieName);
displayResults(cookieValue);
}
</script>
</body>
</html>

View File

@ -1,190 +1,144 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Button Text Node
Author: dsirnapalli@netscape.com
Revs: 01.08.02 - Created
Last Run On:01.23.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accessibility.js"></script>
<script type="text/javascript">
function getDomNodeButtonText()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("button").item(0);
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeButtonText();
accNode = getAccessibleNode(domNode);
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
accNode.accTakeFocus();
domNode = domNode.firstChild;
accNode = getAccessibleNode(domNode);
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}
function constructResults()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var name = getName(accNode);
var role = getRole(accNode);
var state = getState(accNode);
var value = getValue(accNode);
var newvalue = value.toString();
}
catch(e){
alert("Exception**: " + e);
}
var expectedName = " Submit ";
var expectedRole = "42";
var expectedState = "2097216";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.search("NS_ERROR_NOT_IMPLEMENTED"))
row4[3] = "PASS"; else row4[3] = "FAIL";
res += "<table border cols=4 width='70%'>";
res += "<tr>";
for(col=0; col<4; col++)
res += "<td><b>" + row0[col] + "</b></td>";
res += "</tr>";
res += "<tr>";
for(col=0; col<4; 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<4; 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<4; 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<4; col++)
{
if(row4[col] == "FAIL")
res += "<td bgcolor='#FF0000'>" + row4[col] + "</td>";
else
res += "<td>" + row4[col] + "</td>";
}
res += "</tr>";
res += "</table>";
submitToCookie();
}
function submitToCookie()
{
createCookie("nsIAccessibleTestButtonNodeText", res, 14);
setTimeout("window.location.reload();", 2000);
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
var res = "<b><u> Results for HTML Button Text Node:</u></b><br><br>";
if(readCookie("nsIAccessibleTestButtonNodeText") == null)
{
<!-- Test Button -->
document.write('<br>');
document.write('Testing Button..<br><br>');
document.write('<button value="submit"> Submit </button>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie("nsIAccessibleTestButtonNodeText");
eraseCookie("nsIAccessibleTestButtonNodeText");
displayResults(cookieValue);
}
</script>
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
for HTML Button Text Node
Author: dsirnapalli@netscape.com
Revs: 01.08.02 - Created
Last Run On:02.21.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accesslib.js"></script>
<script type="text/javascript">
function getDomNodeButtonText()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("button").item(0);
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeButtonText();
accNode = getAccessibleNode(domNode);
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
accNode.accTakeFocus();
domNode = domNode.firstChild;
accNode = getAccessibleNode(domNode);
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}
function constructResults()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var name = getName(accNode);
var role = getRole(accNode);
var state = getState(accNode);
var value = getValue(accNode);
var newvalue = value.toString();
var expectedName = "Submit";
var expectedRole = "42";
var expectedState = "2097216";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
row = new Array(row0, row1, row2, row3, row4);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.match(expectedValue)) row4[3] = "PASS"; else row4[3] = "FAIL";
appendTableRes();
submitToCookie();
}
catch(e){
alert("Exception**: " + e);
}
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
cookieName = "nsIAccessibleTestButtonNodeText";
var res = "<b><u> Results for HTML Button Text Node:</u></b><br><br>";
if(readCookie(cookieName) == null)
{
<!-- Test Button -->
document.write('<br>');
document.write('<b>Testing Button for Accessibility..</b><br><br>');
document.write('<button value="submit">Submit</button>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie(cookieName);
eraseCookie(cookieName);
displayResults(cookieValue);
}
</script>
</body>
</html>

View File

@ -1,250 +1,212 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Check Box Checked Node
Author: dsirnapalli@netscape.com
Revs: 01.18.02 - Created
Last Run On:01.18.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accessibility.js"></script>
<script type="text/javascript">
function getDomNodeCheckBoxChecked()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("form").item(1);
arr = new Array(5);
arr = node.elements;
return arr[0];
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeCheckBoxChecked();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{ //else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{ //else2
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
accNode.accTakeFocus();
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}//else2
} //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 expectedName = null;
var expectedRole = "44";
var expectedState = "1048596";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var expectedFocus = "Focused";
var expectedTookfocus = "Focused";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
var row5 = new Array("accTakeFocus->", expectedFocus, focus);
var row6 = new Array("accFocused->", expectedTookfocus, tookfocus);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.search("NS_ERROR_NOT_IMPLEMENTED"))
row4[3] = "PASS"; else row4[3] = "FAIL";
if (focus == expectedFocus) row5[3] = "PASS"; else row5[3] = "FAIL";
if (tookfocus == expectedTookfocus) row6[3] = "PASS"; else row6[3] = "FAIL";
res += "<table border cols=4 width='70%'>";
res += "<tr>";
for(col=0; col<4; col++)
res += "<td><b>" + row0[col] + "</b></td>";
res += "</tr>";
res += "<tr>";
for(col=0; col<4; 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<4; 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<4; 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<4; 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<4; 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<4; 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("nsIAccessibleTestCheckBoxCheckedNode", res, 14);
setTimeout("window.location.reload();", 2000);
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
focused = false;
var res = "<b><u> Results for HTML Check Box Checked Node:</u></b><br><br>";
if(readCookie("nsIAccessibleTestCheckBoxCheckedNode") == null)
{
<!-- Test Form -->
document.write('<br><br><b> Testing Check Box Checked </b><br><br>');
document.write('<form>');
document.write('Is your age: <br>');
document.write('<input type="checkbox" name="sex" checked onFocus="focused=true"> Above 30');
document.write('<input type="checkbox" name="sex"> Below 30');
document.write('</form>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie("nsIAccessibleTestCheckBoxCheckedNode");
eraseCookie("nsIAccessibleTestCheckBoxCheckedNode");
displayResults(cookieValue);
}
</script>
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
for HTML Check Box Checked Node
Author: dsirnapalli@netscape.com
Revs: 01.18.02 - Created
Last Run On:02.25.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accesslib.js"></script>
<script type="text/javascript">
function getDomNodeCheckBoxChecked()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("form").item(1);
arr = new Array(5);
arr = node.elements;
return arr[0];
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeCheckBoxChecked();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{//else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// Here we are telling the accessible node to get focus.We had to call constructResults
// after some time interval because it actually takes some time for the accessible
// node to get focus. Before checking pass fail criteria in constructResults method
// we had to give some time for the node to get focus.
accNode.accTakeFocus();
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}//else2
}
}
function constructResults()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// originally we stored the accNode in tempaccNode.
// Below code is used to check where the focus actually is.
// accNode.accFocused returns an accessible node. on that accessible node when you call
// accGetDOMNode it will return the corresponding dom node. if that dom node and
// tempaccNode's dom node is same, that mean focus is on the node we expected it to be on.
if(tempaccNode.accGetDOMNode() == accNode.accFocused.accGetDOMNode())
{
varaccFocused = "Focused";
}
else
{
varaccFocused = "Not Focused";
}
var name = getName();
var role = getRole();
var state = getState();
var value = getValue();
var newvalue = value.toString();
var numActions = getNumActions();
if(numActions > 1)
alert("When i last modified the test case numActions was 1. Now numActions is more than 1. Add tests for other numActions");
var actionName = getActionName();
var action = doAction();
var expectedName = null;
var expectedRole = "44";
var expectedState = "1048596";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var expectednodeFocus = "Focused";
var expectedaccFocused = "Focused";
var expectednumActions = "1";
var expectedactionName = "Uncheck";
var expectednodeCheck = "Check Box Not Checked";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
var row5 = new Array("accTakeFocus()->", expectednodeFocus, nodeFocus);
var row6 = new Array("accFocused->", expectedaccFocused, varaccFocused);
var row7 = new Array("accNumActions->", expectednumActions, numActions);
var row8 = new Array("getAccActionName()->", expectedactionName, actionName);
var row9 = new Array("accDoAction()->", expectednodeCheck, nodeCheck);
row = new Array(row0, row1, row2, row3, row4, row5, row6, row7, row8, row9);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.match(expectedValue)) row4[3] = "PASS"; else row4[3] = "FAIL";
if (nodeFocus == expectednodeFocus) row5[3] = "PASS"; else row5[3] = "FAIL";
if (varaccFocused == expectedaccFocused) row6[3] = "PASS"; else row6[3] = "FAIL";
if (numActions == expectednumActions) row7[3] = "PASS"; else row7[3] = "FAIL";
if (actionName == expectedactionName) row8[3] = "PASS"; else row8[3] = "FAIL";
if (nodeCheck == expectednodeCheck) row9[3] = "PASS"; else row9[3] = "FAIL";
appendTableRes();
submitToCookie();
}
catch(e){
alert("Exception**: " + e);
}
}
function nodeUnChecked()
{
nodeCheck = "Check Box Not Checked";
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
nodeFocus = "Not Focused";
nodeCheck = "Check Box Checked";
cookieName = "nsIAccessibleTestCheckBoxCheckedNode";
var res = "<b><u> Results for HTML Check Box Checked Node:</u></b><br><br>";
if(readCookie(cookieName) == null)
{
<!-- Test Form -->
document.write('<br><br><b> Testing Check Box Checked </b><br><br>');
document.write('<form>');
document.write('Is your age: <br>');
document.write('<input type="checkbox" name="sex" checked onClick="nodeUnChecked();" onFocus="nodeFocused();"> Above 30');
document.write('<input type="checkbox" name="sex"> Below 30');
document.write('</form>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie(cookieName);
eraseCookie(cookieName);
displayResults(cookieValue);
}
</script>
</body>
</html>

View File

@ -1,250 +1,210 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Check Box Node
Author: dsirnapalli@netscape.com
Revs: 01.18.02 - Created
Last Run On:01.24.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accessibility.js"></script>
<script type="text/javascript">
function getDomNodeCheckBox()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("form").item(1);
arr = new Array(5);
arr = node.elements;
return arr[0];
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeCheckBox();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{ //else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{ //else2
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
accNode.accTakeFocus();
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}//else2
} //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 expectedName = null;
var expectedRole = "44";
var expectedState = "1048580";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var expectedFocus = "Focused";
var expectedTookfocus = "Focused";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
var row5 = new Array("accTakeFocus->", expectedFocus, focus);
var row6 = new Array("accFocused->", expectedTookfocus, tookfocus);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.search("NS_ERROR_NOT_IMPLEMENTED"))
row4[3] = "PASS"; else row4[3] = "FAIL";
if (focus == expectedFocus) row5[3] = "PASS"; else row5[3] = "FAIL";
if (tookfocus == expectedTookfocus) row6[3] = "PASS"; else row6[3] = "FAIL";
res += "<table border cols=4 width='70%'>";
res += "<tr>";
for(col=0; col<4; col++)
res += "<td><b>" + row0[col] + "</b></td>";
res += "</tr>";
res += "<tr>";
for(col=0; col<4; 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<4; 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<4; 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<4; 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<4; 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<4; 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("nsIAccessibleTestCheckBoxNode", res, 14);
setTimeout("window.location.reload();", 2000);
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
focused = false;
var res = "<b><u> Results for HTML Check Box Node:</u></b><br><br>";
if(readCookie("nsIAccessibleTestCheckBoxNode") == null)
{
<!-- Test Form -->
document.write('<br><br><b> Testing Check Box </b><br><br>');
document.write('<form>');
document.write('Is your age: <br>');
document.write('<input type="checkbox" name="sex" onFocus="focused=true"> Above 30');
document.write('<input type="checkbox" name="sex"> Below 30');
document.write('</form>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie("nsIAccessibleTestCheckBoxNode");
eraseCookie("nsIAccessibleTestCheckBoxNode");
displayResults(cookieValue);
}
</script>
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
for HTML Check Box Node
Author: dsirnapalli@netscape.com
Revs: 01.18.02 - Created
Last Run On:02.25.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accesslib.js"></script>
<script type="text/javascript">
function getDomNodeCheckBox()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("form").item(1);
arr = new Array(5);
arr = node.elements;
return arr[0];
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeCheckBox();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{//else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// Here we are telling the accessible node to get focus.We had to call constructResults
// after some time interval because it actually takes some time for the accessible
// node to get focus. Before checking pass fail criteria in constructResults method
// we had to give some time for the node to get focus.
accNode.accTakeFocus();
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}//else2
}
}
function constructResults()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// originally we stored the accNode in tempaccNode.
// Below code is used to check where the focus actually is.
// accNode.accFocused returns an accessible node. on that accessible node when you call
// accGetDOMNode it will return the corresponding dom node. if that dom node and
// tempaccNode's dom node is same, that mean focus is on the node we expected it to be on.
if(tempaccNode.accGetDOMNode() == accNode.accFocused.accGetDOMNode())
{
varaccFocused = "Focused";
}
else
{
varaccFocused = "Not Focused";
}
var name = getName();
var role = getRole();
var state = getState();
var value = getValue();
var newvalue = value.toString();
var numActions = getNumActions();
if(numActions > 1)
alert("When i last modified the test case numActions was 1. Now numActions is more than 1. Add tests for other numActions");
var actionName = getActionName();
var action = doAction();
var expectedName = null;
var expectedRole = "44";
var expectedState = "1048580";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var expectednodeFocus = "Focused";
var expectedaccFocused = "Focused";
var expectednumActions = "1";
var expectedactionName = "Check";
var expectednodeCheck = "Check Box Checked";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
var row5 = new Array("accTakeFocus()->", expectednodeFocus, nodeFocus);
var row6 = new Array("accFocused->", expectedaccFocused, varaccFocused);
var row7 = new Array("accNumActions->", expectednumActions, numActions);
var row8 = new Array("getAccActionName()->", expectedactionName, actionName);
var row9 = new Array("accDoAction()->", expectednodeCheck, nodeCheck);
row = new Array(row0, row1, row2, row3, row4, row5, row6, row7, row8, row9);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.match(expectedValue)) row4[3] = "PASS"; else row4[3] = "FAIL";
if (nodeFocus == expectednodeFocus) row5[3] = "PASS"; else row5[3] = "FAIL";
if (varaccFocused == expectedaccFocused) row6[3] = "PASS"; else row6[3] = "FAIL";
if (numActions == expectednumActions) row7[3] = "PASS"; else row7[3] = "FAIL";
if (actionName == expectedactionName) row8[3] = "PASS"; else row8[3] = "FAIL";
if (nodeCheck == expectednodeCheck) row9[3] = "PASS"; else row9[3] = "FAIL";
appendTableRes();
submitToCookie();
}
catch(e){
alert("Exception**: " + e);
}
}
function nodeChecked()
{
nodeCheck = "Check Box Checked";
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
nodeFocus = "Not Focused";
nodeCheck = "Check Box Not Checked";
cookieName = "nsIAccessibleTestCheckBoxNode";
var res = "<b><u> Results for HTML Check Box Node:</u></b><br><br>";
if(readCookie(cookieName) == null)
{
<!-- Test Form -->
document.write('<br><br><b> Testing Check Box </b><br><br>');
document.write('<form>');
document.write('Is your age: <br>');
document.write('<input type="checkbox" name="sex" onClick="nodeChecked();" onFocus="nodeFocused();"> Above 30');
document.write('<input type="checkbox" name="sex"> Below 30');
document.write('</form>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie(cookieName);
eraseCookie(cookieName);
displayResults(cookieValue);
}
</script>
</body>
</html>

View File

@ -1,72 +1,108 @@
<html>
<title> nsIAccessible Interface Test Case </title>
<body>
<b><center> HTML Elements </center></b>
<br>
<!-- Test Anchor -->
<!-- Anchor linking to external file -->
<b> Testing Link </b>
<br>
<a href="http://www.yahoo.com"> External Link </a>
<br>
<!-- Test Form -->
<br><b> Testing Radio Button </b><br>
<form>
Which is your favorite food
<input type="radio" name="favorite" value="mexican"> Mexican
<input type="radio" name="favorite" value="italian"> Italian
<input type="radio" name="favorite" value="japanese"> Japanese
<input type="radio" checked name="favorite" value="other"> Other
<br><br><b> Testing Check Boxes </b></br>
Is your Age
<br>
<input type="checkbox" name="sex"> Above 30
<input type="checkbox" name="sex"> Below 30
</form>
<!-- Test Table -->
<b> Testing Table </b><br>
<table border cols=2 width="50%">
<caption>Test Table</caption>
<tr>
<td> Row1,Col1</td>
<td> Row1,Col2</td>
</tr>
<tr>
<td> Row2,Col1</td>
<td> Row2,Col2</td>
</tr>
<tr>
<td> Row3,Col1</td>
<td> Row3,Col2</td>
</tr>
</table>
<!-- Test Text Area -->
<br><b> Testing Text Area </b><br>
<textarea name="Comment Box" cols="40" rows="8">
Default text..
</textarea>
<!-- Test Select List -->
<br><br>
<b>Testing Select List</b>
<br><br>
Choose your favorite color
<select>
<option>Red</option>
<option>Blue</option>
<option>Green</option>
<option>Yellow</option>
</select>
<!-- Test Button -->
<br><br>
<b> Testing Button </b><br>
<button value="submit"> Submit </button>
</body>
<html>
<title> nsIAccessible Interface Test Case </title>
<body>
<b><center> HTML Elements </center></b>
<br>
<!-- Test Button -->
<br><br>
<b> Testing Button </b><br>
<button value="submit"> Submit </button>
<br><br>
<!-- Test Table -->
<b> Testing Table </b><br>
<table border cols=2 width="50%">
<caption>Test Table</caption>
<tr>
<td> Row1,Col1</td>
<td> Row1,Col2</td>
</tr>
<tr>
<td> Row2,Col1</td>
<td> Row2,Col2</td>
</tr>
<tr>
<td> Row3,Col1</td>
<td> Row3,Col2</td>
</tr>
</table>
<br>
<!-- Test Text Area -->
<br><b> Testing Text Area </b><br>
<textarea name="Comment Box" cols="40" rows="8">
Default text..
</textarea>
<br><br>
<!-- Test Anchor -->
<!-- Anchor linking to external file -->
<b> Testing Link </b>
<br>
<a href="http://home.netscape.com"> External Link </a>
<br>
<!-- Test Form -->
<br><b> Testing Radio Button </b><br>
<form>
Which is your favorite food
<input type="radio" name="favorite" value="mexican"> Mexican
<input type="radio" name="favorite" value="italian"> Italian
<input type="radio" name="favorite" value="japanese"> Japanese
<input type="radio" checked name="favorite" value="other"> Other
<br><br><b> Testing Check Boxes </b></br>
Is your Age
<br>
<input type="checkbox" name="sex"> Above 30
<input type="checkbox" name="sex"> Below 30
</form>
<!-- Test Select List -->
<br>
<b>Testing Select List</b>
<br><br>
Choose your favorite color
<select>
<option>Red</option>
<option>Blue</option>
<option>Green</option>
<option>Yellow</option>
</select>
<!-- Test HTML FieldSet(with Legend) -->
<br><br>
<b>Testing HTML FieldSet(with Legend) for Accessibility..</b>
<br>
<form action="http://www.democompany.com/cgi-bin/postquery.pl" method="post" enctype="multipart/form-data">
<fieldset>
<legend>Customer Identification</legend>
<br><br>
<label>Customer Name:</label>
<input type="text" name="CustomerName" size="25">
<br><br>
<label>Password:</label>
<input type="password" name="CustomerID" size="8" maxlength="8">
<br>
</fieldset>
</form>
<!-- Test HTML FieldSet(without Legend) -->
<br><br>
<b>Testing HTML FieldSet(without Legend) for Accessibility..</b>
<br>
<form action="http://www.democompany.com/cgi-bin/postquery.pl" method="post" enctype="multipart/form-data">
<fieldset>
<br><br>
<label>Customer Name:</label>
<input type="text" name="CustomerName" size="25">
<br><br>
<label>Password:</label>
<input type="password" name="CustomerID" size="8" maxlength="8">
<br>
</fieldset>
</form>
</body>
</html>

View File

@ -1,250 +1,210 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Radio Button Node Checked
Author: dsirnapalli@netscape.com
Revs: 01.18.02 - Created
Last Run On:01.24.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accessibility.js"></script>
<script type="text/javascript">
function getDomNodeRadioButtonChecked()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("form").item(1);
arr = new Array(5);
arr = node.elements;
return arr[3];
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeRadioButtonChecked();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{ //else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{ //else2
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
accNode.accTakeFocus();
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}//else2
} //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 expectedName = null;
var expectedRole = "45";
var expectedState = "1048596";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var expectedFocus = "Focused";
var expectedTookfocus = "Focused";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
var row5 = new Array("accTakeFocus->", expectedFocus, focus);
var row6 = new Array("accFocused->", expectedTookfocus, tookfocus);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.search("NS_ERROR_NOT_IMPLEMENTED"))
row4[3] = "PASS"; else row4[3] = "FAIL";
if (focus == expectedFocus) row5[3] = "PASS"; else row5[3] = "FAIL";
if (tookfocus == expectedTookfocus) row6[3] = "PASS"; else row6[3] = "FAIL";
res += "<table border cols=4 width='70%'>";
res += "<tr>";
for(col=0; col<4; col++)
res += "<td><b>" + row0[col] + "</b></td>";
res += "</tr>";
res += "<tr>";
for(col=0; col<4; 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<4; 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<4; 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<4; 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<4; 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<4; 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("nsIAccessibleTestRadioButtonCheckedNode", res, 14);
setTimeout("window.location.reload();", 2000);
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
focused = false;
var res = "<b><u> Results for HTML Radio Button Checked Node:</u></b><br><br>";
if(readCookie("nsIAccessibleTestRadioButtonCheckedNode") == null)
{
<!-- Test Form -->
document.write('<br><br><b> Testing Radio Button Checked </b><br><br>');
document.write('<form>');
document.write(' Which is your favorite food');
document.write(' <input type="radio" name="favorite" value="mexican"> Mexican');
document.write(' <input type="radio" name="favorite" value="italian"> Italian');
document.write(' <input type="radio" name="favorite" value="japanese"> Japanese');
document.write(' <input type="radio" checked name="favorite" value="other" onFocus="focused=true"> Other');
document.write('</form>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie("nsIAccessibleTestRadioButtonCheckedNode");
eraseCookie("nsIAccessibleTestRadioButtonCheckedNode");
displayResults(cookieValue);
}
</script>
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
for HTML Radio Button Node Checked
Author: dsirnapalli@netscape.com
Revs: 01.18.02 - Created
Last Run On:02.21.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accesslib.js"></script>
<script type="text/javascript">
function getDomNodeRadioButtonChecked()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("form").item(1);
arr = new Array(5);
arr = node.elements;
return arr[3];
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeRadioButtonChecked();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{//else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// Here we are telling the accessible node to get focus.We had to call constructResults
// after some time interval because it actually takes some time for the accessible
// node to get focus. Before checking pass fail criteria in constructResults method
// we had to give some time for the node to get focus.
accNode.accTakeFocus();
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}//else2
}
}
function constructResults()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// originally we stored the accNode in tempaccNode.
// Below code is used to check where the focus actually is.
// accNode.accFocused returns an accessible node. on that accessible node when you call
// accGetDOMNode it will return the corresponding dom node. if that dom node and
// tempaccNode's dom node is same, that mean focus is on the node we expected it to be on.
if(tempaccNode.accGetDOMNode() == accNode.accFocused.accGetDOMNode())
{
varaccFocused = "Focused";
}
else
{
varaccFocused = "Not Focused";
}
var name = getName();
var role = getRole();
var state = getState();
var value = getValue();
var newvalue = value.toString();
var numActions = getNumActions();
if(numActions > 1)
alert("When i last modified the test case numActions was 1. Now numActions is more than 1. Add tests for other numActions");
var actionName = getActionName();
var action = doAction();
var expectedName = null;
var expectedRole = "45";
var expectedState = "1048596";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var expectednodeFocus = "Focused";
var expectedaccFocused = "Focused";
var expectednumActions = "1";
var expectedactionName = "Select";
var expectednodeClick = "Radio Button Clicked";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
var row5 = new Array("accTakeFocus()->", expectednodeFocus, nodeFocus);
var row6 = new Array("accFocused->", expectedaccFocused, varaccFocused);
var row7 = new Array("accNumActions->", expectednumActions, numActions);
var row8 = new Array("getAccActionName()->", expectedactionName, actionName);
var row9 = new Array("accDoAction()->", expectednodeClick, nodeClick);
row = new Array(row0, row1, row2, row3, row4, row5, row6, row7, row8, row9);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.match(expectedValue)) row4[3] = "PASS"; else row4[3] = "FAIL";
if (nodeFocus == expectednodeFocus) row5[3] = "PASS"; else row5[3] = "FAIL";
if (varaccFocused == expectedaccFocused) row6[3] = "PASS"; else row6[3] = "FAIL";
if (numActions == expectednumActions) row7[3] = "PASS"; else row7[3] = "FAIL";
if (actionName == expectedactionName) row8[3] = "PASS"; else row8[3] = "FAIL";
if (nodeClick == expectednodeClick) row9[3] = "PASS"; else row9[3] = "FAIL";
appendTableRes();
submitToCookie();
}
catch(e){
alert("Exception**: " + e);
}
}
function nodeClicked()
{
nodeClick = "Radio Button Clicked";
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
nodeFocus = "Not Focused";
nodeClick = "Radio Button Not Clicked";
cookieName = "nsIAccessibleTestRadioButtonCheckedNode";
var res = "<b><u> Results for HTML Radio Button Checked Node:</u></b><br><br>";
if(readCookie(cookieName) == null)
{
<!-- Test Form -->
document.write('<br><br><b> Testing Radio Button Checked </b><br><br>');
document.write('<form>');
document.write(' Which is your favorite food');
document.write(' <input type="radio" name="favorite" value="mexican"> Mexican');
document.write(' <input type="radio" name="favorite" value="italian"> Italian');
document.write(' <input type="radio" name="favorite" value="japanese"> Japanese');
document.write(' <input type="radio" checked name="favorite" value="other" onClick="nodeClicked();" onFocus="nodeFocused();"> Other');
document.write('</form>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie(cookieName);
eraseCookie(cookieName);
displayResults(cookieValue);
}
</script>
</body>
</html>

View File

@ -1,250 +1,210 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Radio Button Node
Author: dsirnapalli@netscape.com
Revs: 01.18.02 - Created
Last Run On:01.24.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accessibility.js"></script>
<script type="text/javascript">
function getDomNodeRadioButton()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("form").item(1);
arr = new Array(5);
arr = node.elements;
return arr[0];
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeRadioButton();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{ //else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{ //else2
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
accNode.accTakeFocus();
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}//else2
} //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 expectedName = null;
var expectedRole = "45";
var expectedState = "1048580";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var expectedFocus = "Focused";
var expectedTookfocus = "Focused";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
var row5 = new Array("accTakeFocus->", expectedFocus, focus);
var row6 = new Array("accFocused->", expectedTookfocus, tookfocus);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.search("NS_ERROR_NOT_IMPLEMENTED"))
row4[3] = "PASS"; else row4[3] = "FAIL";
if (focus == expectedFocus) row5[3] = "PASS"; else row5[3] = "FAIL";
if (tookfocus == expectedTookfocus) row6[3] = "PASS"; else row6[3] = "FAIL";
res += "<table border cols=4 width='70%'>";
res += "<tr>";
for(col=0; col<4; col++)
res += "<td><b>" + row0[col] + "</b></td>";
res += "</tr>";
res += "<tr>";
for(col=0; col<4; 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<4; 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<4; 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<4; 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<4; 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<4; 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("nsIAccessibleTestRadioButtonNode", res, 14);
setTimeout("window.location.reload();", 2000);
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
focused = false;
var res = "<b><u> Results for HTML Radio Button Node:</u></b><br><br>";
if(readCookie("nsIAccessibleTestRadioButtonNode") == null)
{
<!-- Test Form -->
document.write('<br><br><b> Testing Radio Button </b><br><br>');
document.write('<form>');
document.write(' Which is your favorite food');
document.write(' <input type="radio" name="favorite" value="mexican" onFocus="focused=true"> Mexican');
document.write(' <input type="radio" name="favorite" value="italian"> Italian');
document.write(' <input type="radio" name="favorite" value="japanese"> Japanese');
document.write(' <input type="radio" checked name="favorite" value="other"> Other');
document.write('</form>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie("nsIAccessibleTestRadioButtonNode");
eraseCookie("nsIAccessibleTestRadioButtonNode");
displayResults(cookieValue);
}
</script>
</body>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
for HTML Radio Button Node
Author: dsirnapalli@netscape.com
Revs: 01.18.02 - Created
Last Run On:02.21.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accesslib.js"></script>
<script type="text/javascript">
function getDomNodeRadioButton()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("form").item(1);
arr = new Array(5);
arr = node.elements;
return arr[0];
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeRadioButton();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{//else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// Here we are telling the accessible node to get focus.We had to call constructResults
// after some time interval because it actually takes some time for the accessible
// node to get focus. Before checking pass fail criteria in constructResults method
// we had to give some time for the node to get focus.
accNode.accTakeFocus();
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}//else2
}
}
function constructResults()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// originally we stored the accNode in tempaccNode.
// Below code is used to check where the focus actually is.
// accNode.accFocused returns an accessible node. on that accessible node when you call
// accGetDOMNode it will return the corresponding dom node. if that dom node and
// tempaccNode's dom node is same, that mean focus is on the node we expected it to be on.
if(tempaccNode.accGetDOMNode() == accNode.accFocused.accGetDOMNode())
{
varaccFocused = "Focused";
}
else
{
varaccFocused = "Not Focused";
}
var name = getName();
var role = getRole();
var state = getState();
var value = getValue();
var newvalue = value.toString();
var numActions = getNumActions();
if(numActions > 1)
alert("When i last modified the test case numActions was 1. Now numActions is more than 1. Add tests for other numActions");
var actionName = getActionName();
var action = doAction();
var expectedName = null;
var expectedRole = "45";
var expectedState = "1048580";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var expectednodeFocus = "Focused";
var expectedaccFocused = "Focused";
var expectednumActions = "1";
var expectedactionName = "Select";
var expectednodeClick = "Radio Button Clicked";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
var row5 = new Array("accTakeFocus()->", expectednodeFocus, nodeFocus);
var row6 = new Array("accFocused->", expectedaccFocused, varaccFocused);
var row7 = new Array("accNumActions->", expectednumActions, numActions);
var row8 = new Array("getAccActionName()->", expectedactionName, actionName);
var row9 = new Array("accDoAction()->", expectednodeClick, nodeClick);
row = new Array(row0, row1, row2, row3, row4, row5, row6, row7, row8, row9);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.match(expectedValue)) row4[3] = "PASS"; else row4[3] = "FAIL";
if (nodeFocus == expectednodeFocus) row5[3] = "PASS"; else row5[3] = "FAIL";
if (varaccFocused == expectedaccFocused) row6[3] = "PASS"; else row6[3] = "FAIL";
if (numActions == expectednumActions) row7[3] = "PASS"; else row7[3] = "FAIL";
if (actionName == expectedactionName) row8[3] = "PASS"; else row8[3] = "FAIL";
if (nodeClick == expectednodeClick) row9[3] = "PASS"; else row9[3] = "FAIL";
appendTableRes();
submitToCookie();
}
catch(e){
alert("Exception**: " + e);
}
}
function nodeClicked()
{
nodeClick = "Radio Button Clicked";
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
nodeFocus = "Not Focused";
nodeClick = "Radio Button Not Clicked";
cookieName = "nsIAccessibleTestRadioButtonNode";
var res = "<b><u> Results for HTML Radio Button Node:</u></b><br><br>";
if(readCookie(cookieName) == null)
{
<!-- Test Form -->
document.write('<br><br><b> Testing Radio Button </b><br><br>');
document.write('<form>');
document.write(' Which is your favorite food');
document.write(' <input type="radio" name="favorite" value="mexican" onClick="nodeClicked();" onFocus="nodeFocused();"> Mexican');
document.write(' <input type="radio" name="favorite" value="italian"> Italian');
document.write(' <input type="radio" name="favorite" value="japanese"> Japanese');
document.write(' <input type="radio" checked name="favorite" value="other"> Other');
document.write('</form>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie(cookieName);
eraseCookie(cookieName);
displayResults(cookieValue);
}
</script>
</body>
</html>

View File

@ -1,130 +1,129 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Table Caption Node
Author: dsirnapalli@netscape.com
Revs: 11.20.01 - Created
Last Run On:01.03.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accessibility.js"></script>
<script type="text/javascript">
function getDomNodeTableCaption()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("table").item(0);
node = node.firstChild;
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeTableCaption();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
}
else
{
var accNode = getAccessibleNode(domNode);
if(accNode == "Exception")
{
newres = "The Node you selected is not an Accessible Node";
res += "<table border cols=2 width='75%'>";
res += "<tr>";
res += " <td width='70%'><b>" + newres + "</b></td>";
res += " <td width='30%'> PASS </td>";
res += "</tr>";
res += "</table>";
}
}
createCookie("nsIAccessibleTestTableCaptionNode", res, 14);
setTimeout("window.location.reload();", 2000);
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script TYPE="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
var res = "<b><u> Results for HTML Table Caption Node:</u></b><br><br>";
if(readCookie("nsIAccessibleTestTableCaptionNode") == null)
{
<!-- Test Table -->
document.write('<center>');
document.write('<table border cols=2 width="50%">');
document.write('<caption>Test Table</caption>');
document.write('<tr>');
document.write(' <td> Row1,Col1</td>');
document.write(' <td> Row1,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row2,Col1</td>');
document.write(' <td> Row2,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row3,Col1</td>');
document.write(' <td> Row3,Col2</td>');
document.write('</tr>');
document.write('</table>');
document.write('</center>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie("nsIAccessibleTestTableCaptionNode");
eraseCookie("nsIAccessibleTestTableCaptionNode");
displayResults(cookieValue);
}
</script>
</body>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
for HTML Table Caption Node
Author: dsirnapalli@netscape.com
Revs: 01.20.02 - Created
Last Run On:02.21.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accesslib.js"></script>
<script type="text/javascript">
function getDomNodeTableCaption()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("table").item(0);
node = node.firstChild;
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeTableCaption();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
}
else
{
var accNode = getAccessibleNode(domNode);
if(accNode == "Exception")
{
newres = "The Node you selected is not an Accessible Node";
res += "<table border cols=2 width='75%'>";
res += "<tr>";
res += " <td width='70%'><b>" + newres + "</b></td>";
res += " <td width='30%'> PASS </td>";
res += "</tr>";
res += "</table>";
submitToCookie();
}
}
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script TYPE="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
cookieName = "nsIAccessibleTestTableCaptionNode";
var res = "<b><u> Results for HTML Table Caption Node:</u></b><br><br>";
if(readCookie(cookieName) == null)
{
<!-- Test Table -->
document.write('<center>');
document.write('<table border cols=2 width="50%">');
document.write('<caption>Test Table</caption>');
document.write('<tr>');
document.write(' <td> Row1,Col1</td>');
document.write(' <td> Row1,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row2,Col1</td>');
document.write(' <td> Row2,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row3,Col1</td>');
document.write(' <td> Row3,Col2</td>');
document.write('</tr>');
document.write('</table>');
document.write('</center>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie(cookieName);
eraseCookie(cookieName);
displayResults(cookieValue);
}
</script>
</body>
</html>

View File

@ -1,197 +1,160 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Table Caption Text Node
Author: dsirnapalli@netscape.com
Revs: 11.20.01 - Created
Last Run On: 01.07.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accessibility.js"></script>
<script type="text/javascript">
function getDomNodeTableCaptionText()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("table").item(0);
node = node.firstChild.firstChild;
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeTableCaptionText();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
}
else
{ //else1
var accNode = getAccessibleNode(domNode);
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
}
else
{ //else2
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var name = getName(accNode);
var role = getRole(accNode);
var state = getState(accNode);
var value = getValue(accNode);
var newvalue = value.toString();
var expectedName = "Test Table";
var expectedRole = "42";
var expectedState = "2097216";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.search("NS_ERROR_NOT_IMPLEMENTED"))
row4[3] = "PASS"; else row4[3] = "FAIL";
res += "<table border cols=4 width='70%'>";
res += "<tr>";
for(col=0; col<4; col++)
res += "<td><b>" + row0[col] + "</b></td>";
res += "</tr>";
res += "<tr>";
for(col=0; col<4; 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<4; 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<4; 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<4; col++)
{
if(row4[col] == "FAIL")
res += "<td bgcolor='#FF0000'>" + row4[col] + "</td>";
else
res += "<td>" + row4[col] + "</td>";
}
res += "</tr>";
res += "</table>";
}
catch(e){
alert("Exception**: " + e);
}
}//else2
}//else1
createCookie("nsIAccessibleTestTableCaptionTextNode", res, 14);
setTimeout("window.location.reload();", 2000);
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
var res = "<b><u> Results for HTML Table Caption Text Node:</u></b><br><br>";
if(readCookie("nsIAccessibleTestTableCaptionTextNode") == null)
{
<!-- Test Table -->
document.write('<center>');
document.write('<table border cols=2 width="50%">');
document.write('<caption>Test Table</caption>');
document.write('<tr>');
document.write(' <td> Row1,Col1</td>');
document.write(' <td> Row1,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row2,Col1</td>');
document.write(' <td> Row2,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row3,Col1</td>');
document.write(' <td> Row3,Col2</td>');
document.write('</tr>');
document.write('</table>');
document.write('</center>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie("nsIAccessibleTestTableCaptionTextNode");
eraseCookie("nsIAccessibleTestTableCaptionTextNode");
displayResults(cookieValue);
}
</script>
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
for HTML Table Caption Text Node
Author: dsirnapalli@netscape.com
Revs: 01.20.02 - Created
Last Run On: 02.21.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accesslib.js"></script>
<script type="text/javascript">
function getDomNodeTableCaptionText()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("table").item(0);
node = node.firstChild.firstChild;
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeTableCaptionText();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{ //else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{ //else2
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var name = getName(accNode);
var role = getRole(accNode);
var state = getState(accNode);
var value = getValue(accNode);
var newvalue = value.toString();
var expectedName = "Test Table";
var expectedRole = "42";
var expectedState = "2097216";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
row = new Array(row0, row1, row2, row3, row4);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.match(expectedValue)) row4[3] = "PASS"; else row4[3] = "FAIL";
appendTableRes();
submitToCookie();
}
catch(e){
alert("Exception**: " + e);
}
}//else2
} //else1
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
cookieName = "nsIAccessibleTestTableCaptionTextNode";
var res = "<b><u> Results for HTML Table Caption Text Node:</u></b><br><br>";
if(readCookie(cookieName) == null)
{
<!-- Test Table -->
document.write('<center>');
document.write('<table border cols=2 width="50%">');
document.write('<caption>Test Table</caption>');
document.write('<tr>');
document.write(' <td> Row1,Col1</td>');
document.write(' <td> Row1,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row2,Col1</td>');
document.write(' <td> Row2,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row3,Col1</td>');
document.write(' <td> Row3,Col2</td>');
document.write('</tr>');
document.write('</table>');
document.write('</center>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie(cookieName);
eraseCookie(cookieName);
displayResults(cookieValue);
}
</script>
</body>
</html>

View File

@ -1,196 +1,158 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Table Cell Node
Author: dsirnapalli@netscape.com
Revs: 11.20.01 - Created
Last Run On:01.07.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accessibility.js"></script>
<script type="text/javascript">
function getDomNodeTableCell()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("td").item(0);
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeTableCell();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
}
else
{ //else1
var accNode = getAccessibleNode(domNode);
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
}
else
{ //else2
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var name = getName(accNode);
var role = getRole(accNode);
var state = getState(accNode);
var value = getValue(accNode);
var newvalue = value.toString();
var expectedName = null;
var expectedRole = "29";
var expectedState = "0";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.search("NS_ERROR_NOT_IMPLEMENTED"))
row4[3] = "PASS"; else row4[3] = "FAIL";
res += "<table border cols=4 width='70%'>";
res += "<tr>";
for(col=0; col<4; col++)
res += "<td><b>" + row0[col] + "</b></td>";
res += "</tr>";
res += "<tr>";
for(col=0; col<4; 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<4; 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<4; 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<4; col++)
{
if(row4[col] == "FAIL")
res += "<td bgcolor='#FF0000'>" + row4[col] + "</td>";
else
res += "<td>" + row4[col] + "</td>";
}
res += "</tr>";
res += "</table>";
}
catch(e){
alert("Exception**: " + e);
}
}//else2
}//else1
createCookie("nsIAccessibleTestTableCellNode", res, 14);
setTimeout("window.location.reload();", 2000);
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
var res = "<b><u> Results for HTML Table Cell Node:</u></b><br><br>";
if(readCookie("nsIAccessibleTestTableCellNode") == null)
{
<!-- Test Table -->
document.write('<center>');
document.write('<table border cols=2 width="50%">');
document.write('<caption>Test Table</caption>');
document.write('<tr>');
document.write(' <td> Row1,Col1</td>');
document.write(' <td> Row1,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row2,Col1</td>');
document.write(' <td> Row2,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row3,Col1</td>');
document.write(' <td> Row3,Col2</td>');
document.write('</tr>');
document.write('</table>');
document.write('</center>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie("nsIAccessibleTestTableCellNode");
eraseCookie("nsIAccessibleTestTableCellNode");
displayResults(cookieValue);
}
</script>
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
for HTML Table Cell Node
Author: dsirnapalli@netscape.com
Revs: 01.20.02 - Created
Last Run On:02.21.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accesslib.js"></script>
<script type="text/javascript">
function getDomNodeTableCell()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("td").item(0);
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeTableCell();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{ //else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{ //else2
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var name = getName(accNode);
var role = getRole(accNode);
var state = getState(accNode);
var value = getValue(accNode);
var newvalue = value.toString();
var expectedName = null;
var expectedRole = "29";
var expectedState = "0";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
row = new Array(row0, row1, row2, row3, row4);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.match(expectedValue)) row4[3] = "PASS"; else row4[3] = "FAIL";
appendTableRes();
submitToCookie();
}
catch(e){
alert("Exception**: " + e);
}
}//else2
} //else1
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
cookieName = "nsIAccessibleTestButtonNode";
var res = "<b><u> Results for HTML Table Cell Node:</u></b><br><br>";
if(readCookie(cookieName) == null)
{
<!-- Test Table -->
document.write('<center>');
document.write('<table border cols=2 width="50%">');
document.write('<caption>Test Table</caption>');
document.write('<tr>');
document.write(' <td> Row1,Col1</td>');
document.write(' <td> Row1,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row2,Col1</td>');
document.write(' <td> Row2,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row3,Col1</td>');
document.write(' <td> Row3,Col2</td>');
document.write('</tr>');
document.write('</table>');
document.write('</center>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie(cookieName);
eraseCookie(cookieName);
displayResults(cookieValue);
}
</script>
</body>
</html>

View File

@ -1,200 +1,159 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Table Cell Text Node
Author: dsirnapalli@netscape.com
Revs: 11.20.01 - Created
Last Run On:01.03.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accessibility.js"></script>
<script type="text/javascript">
function getDomNodeTableCellText()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("td").item(0);
node = node.firstChild;
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeTableCellText();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
}
else
{ //else1
var accNode = getAccessibleNode(domNode);
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
}
else
{ //else2
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var name = getName(accNode);
var role = getRole(accNode);
var state = getState(accNode);
var value = getValue(accNode);
var newvalue = value.toString();
var expectedName = " Row1,Col1";
var expectedRole = "42";
var expectedState = "2097216";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.search("NS_ERROR_NOT_IMPLEMENTED"))
row4[3] = "PASS"; else row4[3] = "FAIL";
res += "<table border cols=4 width='70%'>";
res += "<tr>";
for(col=0; col<4; col++)
res += "<td><b>" + row0[col] + "</b></td>";
res += "</tr>";
res += "<tr>";
for(col=0; col<4; 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<4; 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<4; 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<4; col++)
{
if(row4[col] == "FAIL")
res += "<td bgcolor='#FF0000'>" + row4[col] + "</td>";
else
res += "<td>" + row4[col] + "</td>";
}
res += "</tr>";
res += "</table>";
}
catch(e){
alert("Exception**: " + e);
}
}//else2
}//else1
createCookie("nsIAccessibleTestTableCellTextNode", res, 14);
setTimeout("window.location.reload();", 2000);
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
var res = "<b><u> Results for HTML Table Cell Text Node:</u></b><br><br>";
if(readCookie("nsIAccessibleTestTableCellTextNode") == null)
{
<!-- Test Table -->
document.write('<center>');
document.write('<table border cols=2 width="50%">');
document.write('<caption>Test Table</caption>');
document.write('<tr>');
document.write(' <td> Row1,Col1</td>');
document.write(' <td> Row1,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row2,Col1</td>');
document.write(' <td> Row2,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row3,Col1</td>');
document.write(' <td> Row3,Col2</td>');
document.write('</tr>');
document.write('</table>');
document.write('</center>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie("nsIAccessibleTestTableCellTextNode");
eraseCookie("nsIAccessibleTestTableCellTextNode");
displayResults(cookieValue);
}
</script>
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
for HTML Table Cell Text Node
Author: dsirnapalli@netscape.com
Revs: 01.20.02 - Created
Last Run On:02.21.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accesslib.js"></script>
<script type="text/javascript">
function getDomNodeTableCellText()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("td").item(0);
node = node.firstChild;
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeTableCellText();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{ //else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{ //else2
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var name = getName(accNode);
var role = getRole(accNode);
var state = getState(accNode);
var value = getValue(accNode);
var newvalue = value.toString();
var expectedName = " Row1,Col1";
var expectedRole = "42";
var expectedState = "2097216";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
row = new Array(row0, row1, row2, row3, row4);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.match(expectedValue)) row4[3] = "PASS"; else row4[3] = "FAIL";
appendTableRes();
submitToCookie();
}
catch(e){
alert("Exception**: " + e);
}
}//else2
} //else1
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
cookieName = "nsIAccessibleTestTableCellTextNode";
var res = "<b><u> Results for HTML Table Cell Text Node:</u></b><br><br>";
if(readCookie(cookieName) == null)
{
<!-- Test Table -->
document.write('<center>');
document.write('<table border cols=2 width="50%">');
document.write('<caption>Test Table</caption>');
document.write('<tr>');
document.write(' <td> Row1,Col1</td>');
document.write(' <td> Row1,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row2,Col1</td>');
document.write(' <td> Row2,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row3,Col1</td>');
document.write(' <td> Row3,Col2</td>');
document.write('</tr>');
document.write('</table>');
document.write('</center>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie(cookieName);
eraseCookie(cookieName);
displayResults(cookieValue);
}
</script>
</body>
</html>

View File

@ -1,256 +1,158 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Table Node
Author: dsirnapalli@netscape.com
Revs: 11.20.01 - Created
Last Run On:01.24.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accessibility.js"></script>
<script type="text/javascript">
function getDomNodeTable()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("table").item(0);
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeTable();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{ //else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{ //else2
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
accNode.accTakeFocus();
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}//else2
} //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 expectedName = "Test Table";
var expectedRole = "24";
var expectedState = "0";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
// var expectedFocus = "Focused";
var expectedTookfocus = "Not Focused";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
// var row5 = new Array("accTakeFocus->", expectedFocus, focus);
var row6 = new Array("accFocused->", expectedTookfocus, tookfocus);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.search("NS_ERROR_NOT_IMPLEMENTED"))
row4[3] = "PASS"; else row4[3] = "FAIL";
// if (focus == "Focused") row5[3] = "PASS"; else row5[3] = "FAIL";
// if there is focus on table, that means its failed. Table is not focusable.
if (tookfocus == expectedTookfocus) row6[3] = "PASS"; else row6[3] = "FAIL";
res += "<table border cols=4 width='70%'>";
res += "<tr>";
for(col=0; col<4; col++)
res += "<td><b>" + row0[col] + "</b></td>";
res += "</tr>";
res += "<tr>";
for(col=0; col<4; 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<4; 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<4; 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<4; 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<4; 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<4; 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("nsIAccessibleTestTableNode", res, 14);
setTimeout("window.location.reload();", 2000);
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
var res = "<b><u> Results for HTML Table Node:</u></b><br><br>";
if(readCookie("nsIAccessibleTestTableNode") == null)
{
<!-- Test Table -->
document.write('<center>');
document.write('<table border cols=2 width="50%">');
document.write('<caption>Test Table</caption>');
document.write('<tr>');
document.write(' <td> Row1,Col1</td>');
document.write(' <td> Row1,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row2,Col1</td>');
document.write(' <td> Row2,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row3,Col1</td>');
document.write(' <td> Row3,Col2</td>');
document.write('</tr>');
document.write('</table>');
document.write('</center>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie("nsIAccessibleTestTableNode");
eraseCookie("nsIAccessibleTestTableNode");
displayResults(cookieValue);
}
</script>
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
for HTML Table Node
Author: dsirnapalli@netscape.com
Revs: 11.20.01 - Created
Last Run On:02.21.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accesslib.js"></script>
<script type="text/javascript">
function getDomNodeTable()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("table").item(0);
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeTable();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{ //else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{ //else2
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var name = getName(accNode);
var role = getRole(accNode);
var state = getState(accNode);
var value = getValue(accNode);
var newvalue = value.toString();
var expectedName = "Test Table";
var expectedRole = "24";
var expectedState = "0";
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
row = new Array(row0, row1, row2, row3, row4);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.match(expectedValue)) row4[3] = "PASS"; else row4[3] = "FAIL";
appendTableRes();
submitToCookie();
}
catch(e){
alert("Exception**: " + e);
}
}//else2
} //else1
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script type="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
cookieName = "nsIAccessibleTestTableNode";
res = "<b><u> Results for HTML Table Node:</u></b><br><br>";
if(readCookie(cookieName) == null)
{
<!-- Test Table -->
document.write('<center>');
document.write('<table border cols=2 width="50%">');
document.write('<caption>Test Table</caption>');
document.write('<tr>');
document.write(' <td> Row1,Col1</td>');
document.write(' <td> Row1,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row2,Col1</td>');
document.write(' <td> Row2,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row3,Col1</td>');
document.write(' <td> Row3,Col2</td>');
document.write('</tr>');
document.write('</table>');
document.write('</center>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie(cookieName);
eraseCookie(cookieName);
displayResults(cookieValue);
}
</script>
</body>
</html>

View File

@ -1,129 +1,129 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Table Row Node
Author: dsirnapalli@netscape.com
Revs: 11.20.01 - Created
Last Run On:01.07.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accessibility.js"></script>
<script type="text/javascript">
function getDomNodeTableRow()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("tr").item(0);
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeTableRow();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
}
else
{
var accNode = getAccessibleNode(domNode);
if(accNode == "Exception")
{
newres = "The Node you selected is not an Accessible Node";
res += "<table border cols=2 width='75%'>";
res += "<tr>";
res += " <td width='70%'><b>" + newres + "</b></td>";
res += " <td width='30%'> PASS </td>";
res += "</tr>";
res += "</table>";
}
}
createCookie("nsIAccessibleTestTableRowNode", res, 14);
setTimeout("window.location.reload();", 2000);
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script TYPE="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
var res = "<b><u> Results for HTML Table Row Node:</u></b><br><br>";
if(readCookie("nsIAccessibleTestTableRowNode") == null)
{
<!-- Test Table -->
document.write('<center>');
document.write('<table border cols=2 width="50%">');
document.write('<caption>Test Table</caption>');
document.write('<tr>');
document.write(' <td> Row1,Col1</td>');
document.write(' <td> Row1,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row2,Col1</td>');
document.write(' <td> Row2,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row3,Col1</td>');
document.write(' <td> Row3,Col2</td>');
document.write('</tr>');
document.write('</table>');
document.write('</center>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie("nsIAccessibleTestTableRowNode");
eraseCookie("nsIAccessibleTestTableRowNode");
displayResults(cookieValue);
}
</script>
</body>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
for HTML Table Row Node
Author: dsirnapalli@netscape.com
Revs: 01.20.02 - Created
Last Run On:02.21.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accesslib.js"></script>
<script type="text/javascript">
function getDomNodeTableRow()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("tr").item(0);
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeTableRow();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{
var accNode = getAccessibleNode(domNode);
if(accNode == "Exception")
{
newres = "The Node you selected is not an Accessible Node";
res += "<table border cols=2 width='75%'>";
res += "<tr>";
res += " <td width='70%'><b>" + newres + "</b></td>";
res += " <td width='30%'> PASS </td>";
res += "</tr>";
res += "</table>";
submitToCookie();
}
}
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script TYPE="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
cookieName = "nsIAccessibleTestTableRowNode";
var res = "<b><u> Results for HTML Table Row Node:</u></b><br><br>";
if(readCookie(cookieName) == null)
{
<!-- Test Table -->
document.write('<center>');
document.write('<table border cols=2 width="50%">');
document.write('<caption>Test Table</caption>');
document.write('<tr>');
document.write(' <td> Row1,Col1</td>');
document.write(' <td> Row1,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row2,Col1</td>');
document.write(' <td> Row2,Col2</td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> Row3,Col1</td>');
document.write(' <td> Row3,Col2</td>');
document.write('</tr>');
document.write('</table>');
document.write('</center>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie(cookieName);
eraseCookie(cookieName);
displayResults(cookieValue);
}
</script>
</body>
</html>

View File

@ -1,251 +1,190 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface methods for HTML Text Area Node
Author: dsirnapalli@netscape.com
Revs: 11.26.01 - Created
Last Run On:01.23.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accessibility.js"></script>
<script type="text/javascript">
function getDomNodeTextArea()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("textarea").item(0);
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeTextArea();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{ //else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{ //else2
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
accNode.accTakeFocus();
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}//else2
} //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 expectedName = null;
var expectedRole = "42";
var expectedState = "1048580";
var expectedValue = "Default text..";
var expectedFocus = "Focused";
var expectedTookfocus = "Focused";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
var row5 = new Array("accTakeFocus->", expectedFocus, focus);
var row6 = new Array("accFocused->", expectedTookfocus, tookfocus);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (value == expectedValue) row4[3] = "PASS"; else row4[3] = "FAIL";
if (focus == expectedFocus) row5[3] = "PASS"; else row5[3] = "FAIL";
if (tookfocus == expectedTookfocus) row6[3] = "PASS"; else row6[3] = "FAIL";
res += "<table border cols=4 width='70%'>";
res += "<tr>";
for(col=0; col<4; col++)
res += "<td><b>" + row0[col] + "</b></td>";
res += "</tr>";
res += "<tr>";
for(col=0; col<4; 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<4; 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<4; 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<4; 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<4; 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<4; 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("nsIAccessibleTestTextAreaNode", res, 14);
setTimeout("window.location.reload();", 2000);
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script TYPE="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
focused = false;
var res = "<b><u> Results for HTML Text Area Node:</u></b><br><br>";
if(readCookie("nsIAccessibleTestTextAreaNode") == null)
{
<!-- Test Text Area -->
document.write('<b> Testing Text Area </b><br><br>');
document.write('<textarea name="Comment Box" cols="40" rows="8" onFocus="focused=true">');
document.write('Default text..');
document.write('</textarea>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie("nsIAccessibleTestTextAreaNode");
eraseCookie("nsIAccessibleTestTextAreaNode");
displayResults(cookieValue);
}
</script>
</body>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title> nsIAccessible Interface Test Case </title>
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
for HTML Text Area Node
Author: dsirnapalli@netscape.com
Revs: 01.26.02 - Created
Last Run On:02.21.02.
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<head>
<!-- script below is ngdriverspecific -->
<script type="text/javascript" src="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript" src="accesslib.js"></script>
<script type="text/javascript">
function getDomNodeTextArea()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var node = document.getElementsByTagName("textarea").item(0);
return node;
}
catch(e){
alert("Exception: " + e);
}
}
function executeTestCase()
{
var domNode = getDomNodeTextArea();
if(domNode == null)
{
res = res + "Could not get the DOM Node";
submitToCookie();
}
else
{//else1
accNode = getAccessibleNode(domNode);
tempaccNode = accNode;
if(accNode == "Exception")
{
res = res + "The Node you selected is not an Accessible Node";
submitToCookie();
}
else
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// Here we are telling the accessible node to get focus.We had to call constructResults
// after some time interval because it actually takes some time for the accessible
// node to get focus. Before checking pass fail criteria in constructResults method
// we had to give some time for the node to get focus.
accNode.accTakeFocus();
setTimeout("constructResults();", 2000);
}
catch(e){
alert("Exception**: " + e);
}
}//else2
}
}
function constructResults()
{
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// originally we stored the accNode in tempaccNode.
// Below code is used to check where the focus actually is.
// accNode.accFocused returns an accessible node. on that accessible node when you call
// accGetDOMNode it will return the corresponding dom node. if that dom node and
// tempaccNode's dom node is same, that mean focus is on the node we expected it to be on.
if(tempaccNode.accGetDOMNode() == accNode.accFocused.accGetDOMNode())
{
varaccFocused = "Focused";
}
else
{
varaccFocused = "Not Focused";
}
var name = getName();
var role = getRole();
var state = getState();
var value = getValue();
var newvalue = value.toString();
var numActions = getNumActions();
var newnumActions = numActions.toString();
var expectedName = null;
var expectedRole = "42";
var expectedState = "1048580";
var expectedValue = "Default text..";
var expectednodeFocus = "Focused";
var expectedaccFocused = "Focused";
var expectednumActions = "NS_ERROR_NOT_IMPLEMENTED";
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
var row1 = new Array("Name->", expectedName, name);
var row2 = new Array("Role->", expectedRole, role);
var row3 = new Array("State->", expectedState, state);
var row4 = new Array("Value->", expectedValue, value);
var row5 = new Array("accTakeFocus()->", expectednodeFocus, nodeFocus);
var row6 = new Array("accFocused->", expectedaccFocused, varaccFocused);
var row7 = new Array("accNumActions->", expectednumActions, numActions);
row = new Array(row0, row1, row2, row3, row4, row5, row6, row7);
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
if (newvalue.match(expectedValue)) row4[3] = "PASS"; else row4[3] = "FAIL";
if (nodeFocus == expectednodeFocus) row5[3] = "PASS"; else row5[3] = "FAIL";
if (varaccFocused == expectedaccFocused) row6[3] = "PASS"; else row6[3] = "FAIL";
if (newnumActions.match(expectednumActions)) row7[3] = "PASS"; else row7[3] = "FAIL";
appendTableRes();
submitToCookie();
}
catch(e){
alert("Exception**: " + e);
}
}
</script>
</head>
<body>
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script TYPE="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script type="text/javascript">
nodeFocus = "Not Focused";
cookieName = "nsIAccessibleTestTextAreaNode";
var res = "<b><u> Results for HTML Text Area Node:</u></b><br><br>";
if(readCookie(cookieName) == null)
{
<!-- Test Text Area -->
document.write('<b> Testing Text Area </b><br><br>');
document.write('<textarea name="Comment Box" cols="40" rows="8" onFocus="nodeFocused();">');
document.write('Default text..');
document.write('</textarea>');
setTimeout("executeTestCase();", 2000);
}
else
{
var cookieValue = readCookie(cookieName);
eraseCookie(cookieName);
displayResults(cookieValue);
}
</script>
</body>
</html>