Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
4 type="text/css"?>
6 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
7 title="Accessible XUL menu hierarchy tests">
9 <script type="application/javascript"
10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
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" />
19 <script type="application/javascript">
20 <![CDATA[
21 ////////////////////////////////////////////////////////////////////////////
22 // Invokers
24 function openMenu(aID)
25 {
26 this.menuNode = getNode(aID),
28 this.eventSeq = [
29 new invokerChecker(EVENT_FOCUS, this.menuNode)
30 ];
32 this.invoke = function openMenu_invoke()
33 {
34 var tree;
35 if (LINUX || SOLARIS) {
36 tree =
37 { PARENT_MENUITEM: [ ] };
39 } else {
40 tree =
41 { PARENT_MENUITEM: [
42 { MENUPOPUP: [ ] }
43 ] };
44 }
45 testAccessibleTree(aID, tree);
47 // Show menu.
48 this.menuNode.open = true;
49 }
51 this.finalCheck = function openMenu_finalCheck()
52 {
53 var tree;
54 if (LINUX || SOLARIS) {
55 tree =
56 { PARENT_MENUITEM: [
57 { MENUITEM: [ ] },
58 { MENUITEM: [ ] }
59 ] };
61 } else {
62 tree =
63 { PARENT_MENUITEM: [
64 { MENUPOPUP: [
65 { MENUITEM: [ ] },
66 { MENUITEM: [ ] }
67 ] }
68 ] };
69 }
70 testAccessibleTree(aID, tree);
71 }
73 this.getID = function openMenu_getID()
74 {
75 return "open menu " + prettyName(aID);
76 }
77 }
79 ////////////////////////////////////////////////////////////////////////////
80 // Test
82 var gQueue = null;
83 function doTest()
84 {
85 gQueue = new eventQueue();
86 gQueue.push(new openMenu("menu"));
87 gQueue.invoke(); // Will call SimpleTest.finish();
88 }
90 SimpleTest.waitForExplicitFinish();
91 addA11yLoadEvent(doTest);
92 ]]>
93 </script>
95 <hbox flex="1" style="overflow: auto;">
96 <body xmlns="http://www.w3.org/1999/xhtml">
97 <a target="_blank"
98 href="https://bugzilla.mozilla.org/show_bug.cgi?id=249292"
99 title="Ensure accessible children for toolbarbutton types 'menu' and 'menu-button'">
100 Mozilla Bug 249292
101 </a>
102 <a target="_blank"
103 href="https://bugzilla.mozilla.org/show_bug.cgi?id=630486"
104 title="Don't force accessible creation for popup children.">
105 Mozilla Bug 630486
106 </a>
107 <br/>
108 <p id="display"></p>
109 <div id="content" style="display: none">
110 </div>
111 <pre id="test">
112 </pre>
113 </body>
115 <vbox flex="1">
116 <menubar>
117 <menu id="menu" label="menu">
118 <menupopup>
119 <menuitem label="menuitem"/>
120 <menuitem label="menuitem"/>
121 </menupopup>
122 </menu>
123 </menubar>
124 </vbox>
125 </hbox>
127 </window>