1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
3
<title> nsIAccessible Interface Test Case </title>
4
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
5
for HTML FIELDSET WITH LEGEND Node
6
Author: dsirnapalli@netscape.com
10
- The contents of this file are subject to the Mozilla Public
11
- License Version 1.1 (the "License"); you may not use this file
12
- except in compliance with the License. You may obtain a copy of
13
- the License at http://www.mozilla.org/MPL/
15
- Software distributed under the License is distributed on an "AS
16
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
17
- implied. See the License for the specific language governing
18
- rights and limitations under the License.
20
- The Original Code is Mozilla Communicator Test Cases.
22
- The Initial Developer of the Original Code is Netscape Communications
23
- Corp. Portions created by Netscape Communications Corp. are
24
- Copyright (C) 1999 Netscape Communications Corp. All
31
<script type="text/javascript" src="http://www.mozilla.org/quality/embed/jstests/accessibility/jslib/accesslib.js"> </script>
32
<script type="text/javascript" src="http://www.mozilla.org/quality/embed/jstests/accessibility/jslib/bridge.js"> </script>
34
<script type="text/javascript">
36
function getDomNodeFieldset()
39
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
40
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
42
var node = document.getElementsByTagName("form").item(0);
48
alert("Exception: " + e);
52
function executeTestCase()
54
var domNode = getDomNodeFieldset();
55
accNode = getAccessibleNode(domNode);
56
setTimeout("constructResults();", 2000);
59
function constructResults()
62
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
63
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
67
var state = getState();
68
var value = getValue();
69
var newvalue = value.toString();
70
var keyboardShortcut = getAccKeyboardShortcut();
72
var expectedName = "Customer Identification";
73
var expectedRole = "20";
74
var expectedState = "0";
75
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
76
var expectedkeyboardShortcut = "Alt+f";
78
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
79
var row1 = new Array("Name->", expectedName, name);
80
var row2 = new Array("Role->", expectedRole, role);
81
var row3 = new Array("State->", expectedState, state);
82
var row4 = new Array("Value->", expectedValue, value);
83
var row5 = new Array("accKeyboardShortcut->", expectedkeyboardShortcut, keyboardShortcut);
85
row = new Array(row0, row1, row2, row3, row4, row5);
87
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
88
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
89
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
90
if (newvalue.match(expectedValue)) row4[3] = "PASS"; else row4[3] = "FAIL";
91
if (keyboardShortcut == expectedkeyboardShortcut)
92
row5[3] = "PASS"; else row5[3] = "FAIL";
95
if(!isRunningStandalone())
101
alert("Exception**: " + e);
109
<script type="text/javascript">
110
cookieName = "nsIAccessibleTestFieldsetWithLegendNode";
111
res = "<b><u> Results for HTML Fieldset(with Legend) Node:</u></b><br><br>";
113
if(readCookie(cookieName) == null)
115
<!-- Test HTML FieldSet(with Legend) -->
116
document.write('<br>');
117
document.write('<b>Testing HTML FieldSet(with Legend) for Accessibility..</b><br><br>');
118
document.write('<br>');
119
document.write('<form action="http://www.democompany.com/cgi-bin/postquery.pl" method="post" enctype="multipart/form-data">');
121
document.write('<fieldset accesskey="f">');
122
document.write('<legend>Customer Identification</legend>');
123
document.write('<br><br>');
124
document.write('<label>Customer Name:</label>');
125
document.write('<input type="text" name="CustomerName" size="25">');
126
document.write('<br><br>');
127
document.write('<label>Password:</label>');
128
document.write('<input type="password" name="CustomerID" size="8" maxlength="8">');
129
document.write('<br>');
130
document.write('</fieldset>');
131
document.write('</form>');
133
setTimeout("executeTestCase();", 2000);
137
var cookieValue = readCookie(cookieName);
138
eraseCookie(cookieName);
139
document.write(cookieValue);
b'\\ No newline at end of file'