1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/states/test_expandable.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,115 @@ 1.4 +<?xml version="1.0"?> 1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> 1.6 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" 1.7 + type="text/css"?> 1.8 + 1.9 +<!-- Firefox searchbar --> 1.10 +<?xml-stylesheet href="chrome://browser/content/browser.css" 1.11 + type="text/css"?> 1.12 +<!-- SeaMonkey searchbar --> 1.13 +<?xml-stylesheet href="chrome://navigator/content/navigator.css" 1.14 + type="text/css"?> 1.15 + 1.16 +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 1.17 + title="Expanded state change events tests for comboboxes and autocompletes."> 1.18 + 1.19 + <script type="application/javascript" 1.20 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> 1.21 + <script type="application/javascript" 1.22 + src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" /> 1.23 + 1.24 + <script type="application/javascript" 1.25 + src="../autocomplete.js" /> 1.26 + 1.27 + <script type="application/javascript" 1.28 + src="../common.js" /> 1.29 + <script type="application/javascript" 1.30 + src="../role.js" /> 1.31 + <script type="application/javascript" 1.32 + src="../states.js" /> 1.33 + <script type="application/javascript" 1.34 + src="../events.js" /> 1.35 + 1.36 + <script type="application/javascript"> 1.37 + <![CDATA[ 1.38 + //gA11yEventDumpToConsole = true; // debuggin 1.39 + 1.40 + var gQueue = null; 1.41 + function doTest() 1.42 + { 1.43 + gQueue = new eventQueue(); 1.44 + 1.45 + gQueue.push(new openCombobox("menulist")); 1.46 + gQueue.push(new closeCombobox("menulist")); 1.47 + 1.48 + todo(false, "Autocompletes don't fire expanded state change events when popup open. See bug 688480!"); 1.49 + //gQueue.push(new openCombobox("autocomplete")); 1.50 + //gQueue.push(new closeCombobox("autocomplete")); 1.51 + 1.52 + // XXX: searchbar doesn't fire state change events because accessible 1.53 + // parent of combobox_list accessible is pushbutton accessible. 1.54 + //var searchbar = document.getElementById("searchbar"); 1.55 + //gQueue.push(new openHideCombobox(searchbar, true)); 1.56 + //gQueue.push(new openHideCombobox(searchbar, false)); 1.57 + todo(false, "Enable states test for XUL searchbar widget!"); 1.58 + 1.59 + gQueue.onFinish = function() 1.60 + { 1.61 + // unregister 'test-a11y-search' autocomplete search 1.62 + shutdownAutoComplete(); 1.63 + } 1.64 + 1.65 + gQueue.invoke(); // Will call SimpleTest.finish(); 1.66 + } 1.67 + 1.68 + // This is the hack needed for searchbar work outside of browser. 1.69 + function getBrowser() 1.70 + { 1.71 + return { 1.72 + mCurrentBrowser: { engines: new Array() } 1.73 + }; 1.74 + } 1.75 + 1.76 + SimpleTest.waitForExplicitFinish(); 1.77 + 1.78 + // Register 'test-a11y-search' autocomplete search. 1.79 + // XPFE AutoComplete needs to register early. 1.80 + initAutoComplete([ "hello", "hi" ], 1.81 + [ "Beep beep'm beep beep yeah", "Baby you can drive my car" ]); 1.82 + 1.83 + addA11yLoadEvent(doTest); 1.84 + ]]> 1.85 + </script> 1.86 + 1.87 + <hbox style="overflow: auto;" flex="1"> 1.88 + <body xmlns="http://www.w3.org/1999/xhtml"> 1.89 + <a target="_blank" 1.90 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=467057" 1.91 + title="xul menulist doesn't fire expand/collapse state change events"> 1.92 + Mozilla Bug 467057 1.93 + </a> 1.94 + <p id="display"></p> 1.95 + <div id="content" style="display: none"> 1.96 + </div> 1.97 + <pre id="test"> 1.98 + </pre> 1.99 + </body> 1.100 + 1.101 + <vbox flex="1"> 1.102 + <menulist id="menulist"> 1.103 + <menupopup> 1.104 + <menuitem label="item1"/> 1.105 + <menuitem label="item2"/> 1.106 + <menuitem label="item3"/> 1.107 + </menupopup> 1.108 + </menulist> 1.109 + 1.110 + <textbox id="autocomplete" type="autocomplete" 1.111 + autocompletesearch="test-a11y-search"/> 1.112 + 1.113 + <searchbar id="searchbar"/> 1.114 + </vbox> 1.115 + </hbox> 1.116 + 1.117 +</window> 1.118 +