tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_formctrl.xhtml (3126B)


      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 
      6 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
      7        title="Accessible XUL checkbox and radio hierarchy tests">
      8 
      9  <!-- Firefox toolbar -->
     10  <script type="application/javascript"
     11          src="chrome://browser/content/browser.js"/>
     12 
     13  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
     14 
     15  <script type="application/javascript"
     16          src="../common.js" />
     17  <script type="application/javascript"
     18          src="../role.js" />
     19 
     20  <script type="application/javascript">
     21  <![CDATA[
     22    ////////////////////////////////////////////////////////////////////////////
     23    // Test
     24 
     25    function doTest()
     26    {
     27      // checkbox
     28      var accTree = {
     29        role: ROLE_CHECKBUTTON,
     30        children: [ ]
     31      };
     32 
     33      testAccessibleTree("checkbox", accTree);
     34 
     35      // radiogroup
     36      accTree = {
     37        role: ROLE_RADIO_GROUP,
     38        children: [
     39          {
     40            role: ROLE_RADIOBUTTON,
     41            children: [ ]
     42          },
     43          {
     44            role: ROLE_RADIOBUTTON,
     45            children: [ ]
     46          }
     47        ]
     48      };
     49 
     50      testAccessibleTree("radiogroup", accTree);
     51 
     52      // toolbar
     53      accTree = {
     54        role: ROLE_TOOLBAR,
     55        name: "My toolbar",
     56        children: [
     57          {
     58            role: ROLE_PUSHBUTTON,
     59            name: "hello",
     60            children: [ ]
     61          }
     62        ]
     63      };
     64 
     65      testAccessibleTree("toolbar", accTree);
     66 
     67      // toolbar
     68      accTree = {
     69        role: ROLE_TOOLBAR,
     70        name: "My second toolbar",
     71        children: [
     72          {
     73            role: ROLE_PUSHBUTTON,
     74            name: "hello",
     75            children: [ ]
     76          }
     77        ]
     78      };
     79 
     80      testAccessibleTree("toolbar2", accTree);
     81 
     82      if (!SEAMONKEY)
     83        testAccessibleTree("tb_customizable", { TOOLBAR: [] });
     84 
     85      SimpleTest.finish()
     86    }
     87 
     88    SimpleTest.waitForExplicitFinish();
     89    addA11yLoadEvent(doTest);
     90  ]]>
     91  </script>
     92 
     93  <hbox flex="1" style="overflow: auto;">
     94    <body xmlns="http://www.w3.org/1999/xhtml">
     95      <a target="_blank"
     96         href="https://bugzilla.mozilla.org/show_bug.cgi?id=342045"
     97         title="Fix O(n^2) access to all the children of a container">
     98        Mozilla Bug 342045
     99      </a><br/>
    100      <p id="display"></p>
    101      <div id="content" style="display: none">
    102      </div>
    103      <pre id="test">
    104      </pre>
    105    </body>
    106 
    107    <vbox flex="1">
    108      <checkbox id="checkbox" label="checkbox"/>
    109      <radiogroup id="radiogroup">
    110        <radio label="radio1"/>
    111        <radio label="radio2"/>
    112      </radiogroup>
    113      <toolbar id="toolbar" toolbarname="My toolbar">
    114        <toolbarbutton id="button1" label="hello"/>
    115      </toolbar>
    116      <toolbar id="toolbar2" toolbarname="2nd" aria-label="My second toolbar">
    117        <toolbarbutton id="button2" label="hello"/>
    118      </toolbar>
    119 
    120      <toolbar id="tb_customizable" customizable="true"/>
    121    </vbox>
    122  </hbox>
    123 
    124 </window>