accessible/tests/mochitest/treeupdate/test_deck.xul

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:521c1f27b85f
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"?>
5
6 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
7 title="Tree update on XUL deck panel switching">
8
9 <script type="application/javascript"
10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
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="../states.js" />
18 <script type="application/javascript"
19 src="../events.js" />
20
21 <script type="application/javascript">
22 <![CDATA[
23 function switchDeckPanel(aContainerID, aDeckID)
24 {
25 this.panelIndex = 0;
26
27 this.container = getAccessible(aContainerID);
28 this.deckNode = getNode(aDeckID);
29 this.prevPanel = getAccessible(this.deckNode.selectedPanel);
30 this.panelNode = this.deckNode.childNodes[this.panelIndex];
31
32 this.eventSeq = [
33 new invokerChecker(EVENT_HIDE, this.prevPanel),
34 new invokerChecker(EVENT_SHOW, this.panelNode),
35 new invokerChecker(EVENT_REORDER, this.container)
36 ];
37
38 this.invoke = function switchDeckPanel_invoke()
39 {
40 var tree =
41 { GROUPING: [ // role="group"
42 { GROUPING: [ // groupbox, a selected panel #2
43 { PUSHBUTTON: [ ] } // button
44 ] }
45 ] };
46 testAccessibleTree(this.container, tree);
47
48 this.deckNode.selectedIndex = this.panelIndex;
49 }
50
51 this.finalCheck = function switchDeckPanel_finalCheck()
52 {
53 var tree =
54 { GROUPING: [ // role="group"
55 { LABEL: [ // description, a selected panel #1
56 { TEXT_LEAF: [] } // text leaf, a description value
57 ] }
58 ] };
59 testAccessibleTree(this.container, tree);
60 }
61
62 this.getID = function switchDeckPanel_getID()
63 {
64 return "switch deck panel";
65 }
66 }
67
68 var gQueue = null;
69 function doTest()
70 {
71 gQueue = new eventQueue();
72 gQueue.push(new switchDeckPanel("container", "deck"));
73 gQueue.invoke(); // will call SimpleTest.finish();
74 }
75
76 SimpleTest.waitForExplicitFinish();
77 addA11yLoadEvent(doTest);
78 ]]>
79 </script>
80
81 <hbox flex="1" style="overflow: auto;">
82 <body xmlns="http://www.w3.org/1999/xhtml">
83 <a target="_blank"
84 href="https://bugzilla.mozilla.org/show_bug.cgi?id=814836"
85 title=" xul:deck element messes up screen reader">
86 Mozilla Bug 814836
87 </a>
88
89 <p id="display"></p>
90 <div id="content" style="display: none">
91 </div>
92 <pre id="test">
93 </pre>
94 </body>
95
96 <vbox flex="1" id="container" role="group">
97
98 <deck id="deck" selectedIndex="1">
99 <description>This is the first page</description>
100 <groupbox>
101 <button label="This is the second page"/>
102 </groupbox>
103 </deck>
104
105 </vbox>
106 </hbox>
107
108 </window>
109

mercurial