2
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
4
Author: dsirnapalli@netscape.com
8
- The contents of this file are subject to the Mozilla Public
9
- License Version 1.1 (the "License"); you may not use this file
10
- except in compliance with the License. You may obtain a copy of
11
- the License at http://www.mozilla.org/MPL/
13
- Software distributed under the License is distributed on an "AS
14
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
15
- implied. See the License for the specific language governing
16
- rights and limitations under the License.
18
- The Original Code is Mozilla Communicator Test Cases.
20
- The Initial Developer of the Original Code is Netscape Communications
21
- Corp. Portions created by Netscape Communications Corp. are
22
- Copyright (C) 1999 Netscape Communications Corp. All
28
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
32
xmlns:html="http://www.w3.org/1999/xhtml"
33
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
35
<html:script src="http://www.mozilla.org/quality/embed/jstests/accessibility/jslib/accesslib.js"> </html:script>
36
<html:script src="http://www.mozilla.org/quality/embed/jstests/accessibility/jslib/bridge.js"> </html:script>
41
function getDomNodeGroupbox()
44
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
45
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
47
var node = document.getElementsByTagName("groupbox").item(0);
51
alert("Exception: " + e);
55
function executeTestCase()
57
var domNode = getDomNodeGroupbox();
58
accNode = getAccessibleNode(domNode);
59
setTimeout("constructResults();", 2000);
62
function constructResults()
65
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
66
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
70
var state = getState();
71
var value = getValue();
72
var newvalue = value.toString();
73
var keyboardShortcut = getAccKeyboardShortcut();
75
var expectedName = "Answer";
76
var expectedRole = "20";
77
var expectedState = "0";
78
var expectedValue = "NS_ERROR_NOT_IMPLEMENTED";
79
var expectedkeyboardShortcut = "Alt+g";
81
var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
82
var row1 = new Array("Name->", expectedName, name);
83
var row2 = new Array("Role->", expectedRole, role);
84
var row3 = new Array("State->", expectedState, state);
85
var row4 = new Array("Value->", expectedValue, value);
86
var row5 = new Array("accKeyboardShortcut->", expectedkeyboardShortcut, keyboardShortcut);
88
row = new Array(row0, row1, row2, row3, row4, row5);
90
if (name == expectedName) row1[3] = "PASS"; else row1[3] = "FAIL";
91
if (role == expectedRole) row2[3] = "PASS"; else row2[3] = "FAIL";
92
if (state == expectedState) row3[3] = "PASS"; else row3[3] = "FAIL";
93
if (newvalue.match(expectedValue)) row4[3] = "PASS"; else row4[3] = "FAIL";
94
if (keyboardShortcut == expectedkeyboardShortcut)
95
row5[3] = "PASS"; else row5[3] = "FAIL";
101
alert("Exception**: " + e);
108
<box orient="vertical" flex="1">
110
<html:b> Testing XUL Groupbox for Accessibility.. </html:b>
112
<groupbox accesskey="g">
113
<caption label="Answer"/>
114
<description value="Banana"/>
115
<description value="Tangerine"/>
116
<description value="Phone Booth"/>
117
<description value="Kiwi"/>
123
res = "<b><u> Results for XUL Groupbox Node:</u></b><br><br>";
125
setTimeout("executeTestCase();", 2000);
b'\\ No newline at end of file'