Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
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 | <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
michael@0 | 7 | title="Accessibility Group Attributes ('level', 'setsize', 'posinset') Test."> |
michael@0 | 8 | |
michael@0 | 9 | <script type="application/javascript" |
michael@0 | 10 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> |
michael@0 | 11 | |
michael@0 | 12 | <script type="application/javascript" |
michael@0 | 13 | src="../common.js" /> |
michael@0 | 14 | <script type="application/javascript" |
michael@0 | 15 | src="../events.js" /> |
michael@0 | 16 | <script type="application/javascript" |
michael@0 | 17 | src="../attributes.js" /> |
michael@0 | 18 | |
michael@0 | 19 | <script type="application/javascript"> |
michael@0 | 20 | <![CDATA[ |
michael@0 | 21 | function openMenu(aID) |
michael@0 | 22 | { |
michael@0 | 23 | this.menuNode = getNode(aID); |
michael@0 | 24 | |
michael@0 | 25 | this.eventSeq = [ |
michael@0 | 26 | new invokerChecker(EVENT_FOCUS, this.menuNode) |
michael@0 | 27 | ]; |
michael@0 | 28 | |
michael@0 | 29 | this.invoke = function openMenu_invoke() |
michael@0 | 30 | { |
michael@0 | 31 | this.menuNode.open = true; |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | this.finalCheck = function openMenu_finalCheck() |
michael@0 | 35 | { |
michael@0 | 36 | testGroupAttrs("menu_item1.1", 1, 1); |
michael@0 | 37 | testGroupAttrs("menu_item1.2", 1, 3); |
michael@0 | 38 | testGroupAttrs("menu_item1.4", 2, 3); |
michael@0 | 39 | testGroupAttrs("menu_item2", 3, 3); |
michael@0 | 40 | } |
michael@0 | 41 | |
michael@0 | 42 | this.getID = function openMenu_getID() |
michael@0 | 43 | { |
michael@0 | 44 | return "open menu " + prettyName(aID); |
michael@0 | 45 | } |
michael@0 | 46 | } |
michael@0 | 47 | |
michael@0 | 48 | function openSubMenu(aID) |
michael@0 | 49 | { |
michael@0 | 50 | this.menuNode = getNode(aID); |
michael@0 | 51 | |
michael@0 | 52 | this.eventSeq = [ |
michael@0 | 53 | new invokerChecker(EVENT_FOCUS, this.menuNode) |
michael@0 | 54 | ]; |
michael@0 | 55 | |
michael@0 | 56 | this.invoke = function openSubMenu_invoke() |
michael@0 | 57 | { |
michael@0 | 58 | this.menuNode.open = true; |
michael@0 | 59 | } |
michael@0 | 60 | |
michael@0 | 61 | this.finalCheck = function openSubMenu_finalCheck() |
michael@0 | 62 | { |
michael@0 | 63 | testGroupAttrs("menu_item2.1", 1, 2, 1); |
michael@0 | 64 | testGroupAttrs("menu_item2.2", 2, 2, 1); |
michael@0 | 65 | } |
michael@0 | 66 | |
michael@0 | 67 | this.getID = function openSubMenu_getID() |
michael@0 | 68 | { |
michael@0 | 69 | return "open submenu " + prettyName(aID); |
michael@0 | 70 | } |
michael@0 | 71 | } |
michael@0 | 72 | |
michael@0 | 73 | //gA11yEventDumpToConsole = true; // debug stuff |
michael@0 | 74 | |
michael@0 | 75 | var gQueue = null; |
michael@0 | 76 | function doTest() |
michael@0 | 77 | { |
michael@0 | 78 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 79 | // xul:listbox (bug 417317) |
michael@0 | 80 | testGroupAttrs("listitem1", 1, 4); |
michael@0 | 81 | testGroupAttrs("listitem2", 2, 4); |
michael@0 | 82 | testGroupAttrs("listitem3", 3, 4); |
michael@0 | 83 | testGroupAttrs("listitem4", 4, 4); |
michael@0 | 84 | |
michael@0 | 85 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 86 | // xul:tab |
michael@0 | 87 | testGroupAttrs("tab1", 1, 2); |
michael@0 | 88 | testGroupAttrs("tab2", 2, 2); |
michael@0 | 89 | |
michael@0 | 90 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 91 | // xul:radio |
michael@0 | 92 | testGroupAttrs("radio1", 1, 2); |
michael@0 | 93 | testGroupAttrs("radio2", 2, 2); |
michael@0 | 94 | |
michael@0 | 95 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 96 | // xul:menulist |
michael@0 | 97 | testGroupAttrs("menulist1.1", 1); |
michael@0 | 98 | testGroupAttrs("menulist1.2", 2); |
michael@0 | 99 | testGroupAttrs("menulist1.3", 3); |
michael@0 | 100 | testGroupAttrs("menulist1.4", 4); |
michael@0 | 101 | |
michael@0 | 102 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 103 | // ARIA menu (bug 441888) |
michael@0 | 104 | testGroupAttrs("aria-menuitem", 1, 3); |
michael@0 | 105 | testGroupAttrs("aria-menuitemcheckbox", 2, 3); |
michael@0 | 106 | testGroupAttrs("aria-menuitemradio", 3, 3); |
michael@0 | 107 | testGroupAttrs("aria-menuitem2", 1, 1); |
michael@0 | 108 | |
michael@0 | 109 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 110 | // xul:menu (bug 443881) |
michael@0 | 111 | gQueue = new eventQueue(); |
michael@0 | 112 | gQueue.push(new openMenu("menu_item1")); |
michael@0 | 113 | gQueue.push(new openSubMenu("menu_item2")); |
michael@0 | 114 | gQueue.invoke(); // SimpleTest.finish(); |
michael@0 | 115 | } |
michael@0 | 116 | |
michael@0 | 117 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 118 | addA11yLoadEvent(doTest); |
michael@0 | 119 | ]]> |
michael@0 | 120 | </script> |
michael@0 | 121 | |
michael@0 | 122 | <hbox flex="1" style="overflow: auto;"> |
michael@0 | 123 | <body xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 124 | <a target="_blank" |
michael@0 | 125 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=417317" |
michael@0 | 126 | title="Certain types of LISTITEM accessibles no longer get attributes set like 'x of y', regression from fix for bug 389926"> |
michael@0 | 127 | Mozilla Bug 417317 |
michael@0 | 128 | </a><br/> |
michael@0 | 129 | <a target="_blank" |
michael@0 | 130 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=443881" |
michael@0 | 131 | title="take into account separators in xul menus when group attributes are calculating"> |
michael@0 | 132 | Mozilla Bug 443881 |
michael@0 | 133 | </a><br/> |
michael@0 | 134 | <a target="_blank" |
michael@0 | 135 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=441888" |
michael@0 | 136 | title="ARIA checked menu items are not included in the total list of menu items"> |
michael@0 | 137 | Mozilla Bug 441888 |
michael@0 | 138 | </a><br/> |
michael@0 | 139 | |
michael@0 | 140 | <p id="display"></p> |
michael@0 | 141 | <div id="content" style="display: none"> |
michael@0 | 142 | </div> |
michael@0 | 143 | <pre id="test"> |
michael@0 | 144 | </pre> |
michael@0 | 145 | </body> |
michael@0 | 146 | |
michael@0 | 147 | <vbox flex="1"> |
michael@0 | 148 | |
michael@0 | 149 | <listbox> |
michael@0 | 150 | <listitem label="listitem1" id="listitem1"/> |
michael@0 | 151 | <listitem label="listitem2" id="listitem2" type="checkbox"/> |
michael@0 | 152 | <listitem label="listitem3" id="listitem3" type="checkbox"/> |
michael@0 | 153 | <listitem label="listitem4" id="listitem4"/> |
michael@0 | 154 | </listbox> |
michael@0 | 155 | |
michael@0 | 156 | <menubar> |
michael@0 | 157 | <menu label="item1" id="menu_item1"> |
michael@0 | 158 | <menupopup> |
michael@0 | 159 | <menuitem label="item1.1" id="menu_item1.1"/> |
michael@0 | 160 | <menuseparator/> |
michael@0 | 161 | <menuitem label="item1.2" id="menu_item1.2"/> |
michael@0 | 162 | <menuitem label="item1.3" hidden="true"/> |
michael@0 | 163 | <menuitem label="item1.4" id="menu_item1.4"/> |
michael@0 | 164 | <menu label="item2" id="menu_item2"> |
michael@0 | 165 | <menupopup> |
michael@0 | 166 | <menuitem label="item2.1" id="menu_item2.1"/> |
michael@0 | 167 | <menuitem label="item2.2" id="menu_item2.2"/> |
michael@0 | 168 | </menupopup> |
michael@0 | 169 | </menu> |
michael@0 | 170 | </menupopup> |
michael@0 | 171 | </menu> |
michael@0 | 172 | </menubar> |
michael@0 | 173 | |
michael@0 | 174 | <tabbox> |
michael@0 | 175 | <tabs> |
michael@0 | 176 | <tab id="tab1" label="tab1"/> |
michael@0 | 177 | <tab id="tab2" label="tab3"/> |
michael@0 | 178 | </tabs> |
michael@0 | 179 | <tabpanels> |
michael@0 | 180 | <tabpanel/> |
michael@0 | 181 | <tabpanel/> |
michael@0 | 182 | </tabpanels> |
michael@0 | 183 | </tabbox> |
michael@0 | 184 | |
michael@0 | 185 | <radiogroup> |
michael@0 | 186 | <radio id="radio1" label="radio1"/> |
michael@0 | 187 | <radio id="radio2" label="radio2"/> |
michael@0 | 188 | </radiogroup> |
michael@0 | 189 | |
michael@0 | 190 | <menulist id="menulist1" label="Vehicle"> |
michael@0 | 191 | <menupopup> |
michael@0 | 192 | <menuitem id="menulist1.1" label="Car"/> |
michael@0 | 193 | <menuitem id="menulist1.2" label="Taxi"/> |
michael@0 | 194 | <menuitem id="menulist1.3" label="Bus" selected="true"/> |
michael@0 | 195 | <menuitem id="menulist1.4" label="Train"/> |
michael@0 | 196 | </menupopup> |
michael@0 | 197 | </menulist> |
michael@0 | 198 | |
michael@0 | 199 | <vbox> |
michael@0 | 200 | <description role="menuitem" id="aria-menuitem" |
michael@0 | 201 | value="conventional menuitem"/> |
michael@0 | 202 | <description role="menuitemcheckbox" id="aria-menuitemcheckbox" |
michael@0 | 203 | value="conventional checkbox menuitem"/> |
michael@0 | 204 | <description role="menuitem" hidden="true"/> |
michael@0 | 205 | <description role="menuitemradio" id="aria-menuitemradio" |
michael@0 | 206 | value="conventional radio menuitem"/> |
michael@0 | 207 | <description role="separator" |
michael@0 | 208 | value="conventional separator"/> |
michael@0 | 209 | <description role="menuitem" id="aria-menuitem2" |
michael@0 | 210 | value="conventional menuitem"/> |
michael@0 | 211 | </vbox> |
michael@0 | 212 | |
michael@0 | 213 | </vbox> |
michael@0 | 214 | </hbox> |
michael@0 | 215 | </window> |
michael@0 | 216 |