accessible/tests/mochitest/states/test_expandable.xul

branch
TOR_BUG_9701
changeset 8
97036ab72558
equal deleted inserted replaced
-1:000000000000 0:e56cd9190c8a
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 <!-- Firefox searchbar -->
7 <?xml-stylesheet href="chrome://browser/content/browser.css"
8 type="text/css"?>
9 <!-- SeaMonkey searchbar -->
10 <?xml-stylesheet href="chrome://navigator/content/navigator.css"
11 type="text/css"?>
12
13 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
14 title="Expanded state change events tests for comboboxes and autocompletes.">
15
16 <script type="application/javascript"
17 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
18 <script type="application/javascript"
19 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
20
21 <script type="application/javascript"
22 src="../autocomplete.js" />
23
24 <script type="application/javascript"
25 src="../common.js" />
26 <script type="application/javascript"
27 src="../role.js" />
28 <script type="application/javascript"
29 src="../states.js" />
30 <script type="application/javascript"
31 src="../events.js" />
32
33 <script type="application/javascript">
34 <![CDATA[
35 //gA11yEventDumpToConsole = true; // debuggin
36
37 var gQueue = null;
38 function doTest()
39 {
40 gQueue = new eventQueue();
41
42 gQueue.push(new openCombobox("menulist"));
43 gQueue.push(new closeCombobox("menulist"));
44
45 todo(false, "Autocompletes don't fire expanded state change events when popup open. See bug 688480!");
46 //gQueue.push(new openCombobox("autocomplete"));
47 //gQueue.push(new closeCombobox("autocomplete"));
48
49 // XXX: searchbar doesn't fire state change events because accessible
50 // parent of combobox_list accessible is pushbutton accessible.
51 //var searchbar = document.getElementById("searchbar");
52 //gQueue.push(new openHideCombobox(searchbar, true));
53 //gQueue.push(new openHideCombobox(searchbar, false));
54 todo(false, "Enable states test for XUL searchbar widget!");
55
56 gQueue.onFinish = function()
57 {
58 // unregister 'test-a11y-search' autocomplete search
59 shutdownAutoComplete();
60 }
61
62 gQueue.invoke(); // Will call SimpleTest.finish();
63 }
64
65 // This is the hack needed for searchbar work outside of browser.
66 function getBrowser()
67 {
68 return {
69 mCurrentBrowser: { engines: new Array() }
70 };
71 }
72
73 SimpleTest.waitForExplicitFinish();
74
75 // Register 'test-a11y-search' autocomplete search.
76 // XPFE AutoComplete needs to register early.
77 initAutoComplete([ "hello", "hi" ],
78 [ "Beep beep'm beep beep yeah", "Baby you can drive my car" ]);
79
80 addA11yLoadEvent(doTest);
81 ]]>
82 </script>
83
84 <hbox style="overflow: auto;" flex="1">
85 <body xmlns="http://www.w3.org/1999/xhtml">
86 <a target="_blank"
87 href="https://bugzilla.mozilla.org/show_bug.cgi?id=467057"
88 title="xul menulist doesn't fire expand/collapse state change events">
89 Mozilla Bug 467057
90 </a>
91 <p id="display"></p>
92 <div id="content" style="display: none">
93 </div>
94 <pre id="test">
95 </pre>
96 </body>
97
98 <vbox flex="1">
99 <menulist id="menulist">
100 <menupopup>
101 <menuitem label="item1"/>
102 <menuitem label="item2"/>
103 <menuitem label="item3"/>
104 </menupopup>
105 </menulist>
106
107 <textbox id="autocomplete" type="autocomplete"
108 autocompletesearch="test-a11y-search"/>
109
110 <searchbar id="searchbar"/>
111 </vbox>
112 </hbox>
113
114 </window>
115

mercurial