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