tor-browser

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

test_select.html (2981B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4  <title>HTML select control tests</title>
      5  <link rel="stylesheet" type="text/css"
      6        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
      7 
      8  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
      9 
     10  <script type="application/javascript"
     11          src="../common.js"></script>
     12  <script type="application/javascript"
     13          src="../role.js"></script>
     14 
     15  <script type="application/javascript">
     16    function doTest() {
     17      var accTree = {
     18        role: ROLE_LISTBOX,
     19        children: [
     20          {
     21            role: ROLE_GROUPING,
     22            children: [
     23              {
     24                role: ROLE_STATICTEXT,
     25                children: [ ],
     26              },
     27              {
     28                role: ROLE_STATICTEXT,
     29                children: [ ],
     30              },
     31              {
     32                role: ROLE_OPTION,
     33                children: [
     34                  {
     35                    role: ROLE_TEXT_LEAF,
     36                  },
     37                ],
     38              },
     39              {
     40                role: ROLE_OPTION,
     41                children: [
     42                  {
     43                    role: ROLE_TEXT_LEAF,
     44                  },
     45                ],
     46              },
     47            ],
     48          },
     49          {
     50            role: ROLE_OPTION,
     51            children: [
     52              {
     53                role: ROLE_TEXT_LEAF,
     54              },
     55            ],
     56          },
     57        ],
     58      };
     59      testAccessibleTree("listbox", accTree);
     60 
     61      accTree = {
     62        role: ROLE_COMBOBOX,
     63        children: [
     64          {
     65            role: ROLE_COMBOBOX_LIST,
     66            children: [
     67              {
     68                role: ROLE_GROUPING,
     69                children: [
     70                  {
     71                    role: ROLE_COMBOBOX_OPTION,
     72                    children: [ ],
     73                  },
     74                  {
     75                    role: ROLE_COMBOBOX_OPTION,
     76                    children: [ ],
     77                  },
     78                ],
     79              },
     80              {
     81                role: ROLE_COMBOBOX_OPTION,
     82                children: [ ],
     83              },
     84            ],
     85          },
     86        ],
     87      };
     88      testAccessibleTree("combobox", accTree);
     89 
     90      SimpleTest.finish();
     91    }
     92 
     93    SimpleTest.waitForExplicitFinish();
     94    addA11yLoadEvent(doTest);
     95  </script>
     96 </head>
     97 <body>
     98 
     99  <a target="_blank"
    100     title="remove all the code in #ifdef COMBO_BOX_WITH_THREE_CHILDREN"
    101     href="https://bugzilla.mozilla.org/show_bug.cgi?id=506616">
    102    Mozilla Bug 506616
    103  </a>
    104  <p id="display"></p>
    105  <div id="content" style="display: none"></div>
    106  <pre id="test">
    107  </pre>
    108 
    109  <select id="listbox" size="4">
    110    <optgroup label="Colors">
    111      <option>Red</option>
    112      <option>Blue</option>
    113    </optgroup>
    114    <option>Animal</option>
    115  </select>
    116 
    117  <select id="combobox">
    118    <optgroup label="Colors">
    119      <option>Red</option>
    120      <option>Blue</option>
    121    </optgroup>
    122    <option>Animal</option>
    123  </select>
    124 </body>
    125 </html>