accessible/tests/mochitest/states/test_expandable.xul

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

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

mercurial