accessible/tests/mochitest/selectable/test_menulist.xul

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

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.

     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 <?xml-stylesheet href="../treeview.css" type="text/css"?>
     7 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     8         title="XUL tree selectable tests">
    10   <script type="application/javascript"
    11           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
    13   <script type="application/javascript"
    14           src="../common.js" />
    15   <script type="application/javascript"
    16           src="../role.js" />
    17   <script type="application/javascript"
    18           src="../states.js" />
    19   <script type="application/javascript"
    20           src="../selectable.js" />
    22   <script type="application/javascript">
    23   <![CDATA[
    25     ////////////////////////////////////////////////////////////////////////////
    26     // Test
    28     //gA11yEventDumpID = "debug";
    30     var gQueue = null;
    32     function doTest()
    33     {
    34       //////////////////////////////////////////////////////////////////////////
    35       // menulist aka combobox
    37       var id = "combobox";
    38       var combobox = getAccessible(id);
    39       var comboboxList = combobox.firstChild;
    40       ok(isAccessible(comboboxList, [nsIAccessibleSelectable]),
    41          "No selectable accessible for list of " + id);
    43       var select = getAccessible(comboboxList, [nsIAccessibleSelectable]);
    44       testSelectableSelection(select, [ "cb1_item1" ]);
    46       select.addItemToSelection(1);
    47       testSelectableSelection(select, [ "cb1_item2" ], "addItemToSelection(1): ");
    49       select.removeItemFromSelection(1);
    50       testSelectableSelection(select, [ ],
    51                               "removeItemFromSelection(1): ");
    53       is(select.selectAll(), false,
    54          "No way to select all items in combobox '" + id + "'");
    55       testSelectableSelection(select, [ ], "selectAll: ");
    57       select.addItemToSelection(1);
    58       select.unselectAll();
    59       testSelectableSelection(select, [ ], "unselectAll: ");
    61       SimpleTest.finish();
    62     }
    64     SimpleTest.waitForExplicitFinish();
    65     addA11yLoadEvent(doTest);
    66   ]]>
    67   </script>
    69   <hbox flex="1" style="overflow: auto;">
    70     <body xmlns="http://www.w3.org/1999/xhtml">
    71       <a target="_blank"
    72         href="https://bugzilla.mozilla.org/show_bug.cgi?id=590176"
    73         title="add pseudo SelectAccessible interface">
    74        Mozilla Bug 590176
    75       </a><br/>
    76       <p id="display"></p>
    77       <div id="content" style="display: none">
    78       </div>
    79       <pre id="test">
    80       </pre>
    81     </body>
    83     <vbox flex="1">
    84       <menulist id="combobox">
    85         <menupopup>
    86           <menuitem id="cb1_item1" label="item1"/>
    87           <menuitem id="cb1_item2" label="item2"/>
    88         </menupopup>
    89       </menulist>
    91       <vbox id="debug"/>
    92     </vbox>
    93   </hbox>
    95 </window>

mercurial