Source code

Revision control

Other Tools

1
<?xml version="1.0"?>
2
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
4
type="text/css"?>
5
7
title="Accessible XUL button hierarchy tests">
8
11
12
<script type="application/javascript"
13
src="../common.js" />
14
<script type="application/javascript"
15
src="../role.js" />
16
<script type="application/javascript"
17
src="../events.js" />
18
19
<script type="application/javascript">
20
<![CDATA[
21
22
////////////////////////////////////////////////////////////////////////////
23
// Invokers
24
25
function openMenu(aButtonID, aMenuItemRole)
26
{
27
var menuItemRole = aMenuItemRole || ROLE_MENUITEM;
28
this.button = getAccessible(aButtonID);
29
this.menupopup = this.button.firstChild;
30
31
var checker = new invokerChecker(EVENT_REORDER, this.menupopup);
32
this.__proto__ = new synthClick(aButtonID, checker);
33
34
this.invoke = function openMenu_invoke()
35
{
36
var tree =
37
{ PUSHBUTTON: [
38
{ MENUPOPUP: [ ] }
39
] };
40
testAccessibleTree(this.button, tree);
41
42
this.__proto__.invoke();
43
}
44
45
this.finalCheck = function openMenu_finalCheck()
46
{
47
var tree =
48
{ PUSHBUTTON: [
49
{ MENUPOPUP: [
50
{ role: menuItemRole, children: [ ] },
51
{ role: menuItemRole, children: [ ] }
52
] }
53
] };
54
testAccessibleTree(this.button, tree);
55
56
synthesizeKey("KEY_Escape");
57
}
58
59
this.getID = function openMenu_getID()
60
{
61
return "open menu of the button " + prettyName(aButtonID);
62
}
63
}
64
65
////////////////////////////////////////////////////////////////////////////
66
// Do test
67
68
gA11yEventDumpToConsole = true; // debug stuff
69
70
var gQueue = null;
71
72
function doTest()
73
{
74
gQueue = new eventQueue();
75
76
gQueue.push(new openMenu("button1"));
77
gQueue.push(new openMenu("button3"));
78
79
var columnPickerBtn = getAccessible("tree").firstChild.lastChild;
80
gQueue.push(new openMenu(columnPickerBtn, ROLE_CHECK_MENU_ITEM));
81
gQueue.invoke(); // SimpleTest.finish()
82
}
83
84
SimpleTest.waitForExplicitFinish();
85
addA11yLoadEvent(doTest);
86
]]>
87
</script>
88
89
<hbox flex="1" style="overflow: auto;">
90
<body xmlns="http://www.w3.org/1999/xhtml">
91
<a target="_blank"
93
title="Ensure accessible children for toolbarbutton types 'menu'">
95
</a>
96
<a target="_blank"
98
title="Don't force accessible creation for popup children">
100
</a>
101
<a target="_blank"
103
title="Column header selection popup no longer exposed to accessibility APIs">
105
</a>
106
<br/>
107
<p id="display"></p>
108
<div id="content" style="display: none">
109
</div>
110
<pre id="test">
111
</pre>
112
</body>
113
114
<vbox flex="1">
115
<button id="button1" type="menu" label="button">
116
<menupopup>
117
<menuitem label="menuitem"/>
118
<menuitem label="menuitem"/>
119
</menupopup>
120
</button>
121
122
<toolbarbutton id="button3" type="menu" label="toolbarbutton">
123
<menupopup>
124
<menuitem label="menuitem"/>
125
<menuitem label="menuitem"/>
126
</menupopup>
127
</toolbarbutton>
128
129
<tree id="tree" flex="1">
130
<treecols>
131
<treecol id="col" flex="1" primary="true" label="column"/>
132
<treecol id="col2" flex="1" label="another column"/>
133
</treecols>
134
<treechildren/>
135
</tree>
136
</vbox>
137
</hbox>
138
139
</window>
140