1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/treeupdate/test_menu.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,128 @@ 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 +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 1.10 + title="Accessible XUL menu hierarchy tests"> 1.11 + 1.12 + <script type="application/javascript" 1.13 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> 1.14 + 1.15 + <script type="application/javascript" 1.16 + src="../common.js" /> 1.17 + <script type="application/javascript" 1.18 + src="../role.js" /> 1.19 + <script type="application/javascript" 1.20 + src="../events.js" /> 1.21 + 1.22 + <script type="application/javascript"> 1.23 + <![CDATA[ 1.24 + //////////////////////////////////////////////////////////////////////////// 1.25 + // Invokers 1.26 + 1.27 + function openMenu(aID) 1.28 + { 1.29 + this.menuNode = getNode(aID), 1.30 + 1.31 + this.eventSeq = [ 1.32 + new invokerChecker(EVENT_FOCUS, this.menuNode) 1.33 + ]; 1.34 + 1.35 + this.invoke = function openMenu_invoke() 1.36 + { 1.37 + var tree; 1.38 + if (LINUX || SOLARIS) { 1.39 + tree = 1.40 + { PARENT_MENUITEM: [ ] }; 1.41 + 1.42 + } else { 1.43 + tree = 1.44 + { PARENT_MENUITEM: [ 1.45 + { MENUPOPUP: [ ] } 1.46 + ] }; 1.47 + } 1.48 + testAccessibleTree(aID, tree); 1.49 + 1.50 + // Show menu. 1.51 + this.menuNode.open = true; 1.52 + } 1.53 + 1.54 + this.finalCheck = function openMenu_finalCheck() 1.55 + { 1.56 + var tree; 1.57 + if (LINUX || SOLARIS) { 1.58 + tree = 1.59 + { PARENT_MENUITEM: [ 1.60 + { MENUITEM: [ ] }, 1.61 + { MENUITEM: [ ] } 1.62 + ] }; 1.63 + 1.64 + } else { 1.65 + tree = 1.66 + { PARENT_MENUITEM: [ 1.67 + { MENUPOPUP: [ 1.68 + { MENUITEM: [ ] }, 1.69 + { MENUITEM: [ ] } 1.70 + ] } 1.71 + ] }; 1.72 + } 1.73 + testAccessibleTree(aID, tree); 1.74 + } 1.75 + 1.76 + this.getID = function openMenu_getID() 1.77 + { 1.78 + return "open menu " + prettyName(aID); 1.79 + } 1.80 + } 1.81 + 1.82 + //////////////////////////////////////////////////////////////////////////// 1.83 + // Test 1.84 + 1.85 + var gQueue = null; 1.86 + function doTest() 1.87 + { 1.88 + gQueue = new eventQueue(); 1.89 + gQueue.push(new openMenu("menu")); 1.90 + gQueue.invoke(); // Will call SimpleTest.finish(); 1.91 + } 1.92 + 1.93 + SimpleTest.waitForExplicitFinish(); 1.94 + addA11yLoadEvent(doTest); 1.95 + ]]> 1.96 + </script> 1.97 + 1.98 + <hbox flex="1" style="overflow: auto;"> 1.99 + <body xmlns="http://www.w3.org/1999/xhtml"> 1.100 + <a target="_blank" 1.101 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=249292" 1.102 + title="Ensure accessible children for toolbarbutton types 'menu' and 'menu-button'"> 1.103 + Mozilla Bug 249292 1.104 + </a> 1.105 + <a target="_blank" 1.106 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=630486" 1.107 + title="Don't force accessible creation for popup children."> 1.108 + Mozilla Bug 630486 1.109 + </a> 1.110 + <br/> 1.111 + <p id="display"></p> 1.112 + <div id="content" style="display: none"> 1.113 + </div> 1.114 + <pre id="test"> 1.115 + </pre> 1.116 + </body> 1.117 + 1.118 + <vbox flex="1"> 1.119 + <menubar> 1.120 + <menu id="menu" label="menu"> 1.121 + <menupopup> 1.122 + <menuitem label="menuitem"/> 1.123 + <menuitem label="menuitem"/> 1.124 + </menupopup> 1.125 + </menu> 1.126 + </menubar> 1.127 + </vbox> 1.128 + </hbox> 1.129 + 1.130 +</window> 1.131 +