accessible/tests/mochitest/tree/test_select.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/tree/test_select.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,139 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>HTML select control tests</title>
     1.8 +  <link rel="stylesheet" type="text/css"
     1.9 +        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    1.10 +
    1.11 +  <script type="application/javascript"
    1.12 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +
    1.14 +  <script type="application/javascript"
    1.15 +          src="../common.js"></script>
    1.16 +  <script type="application/javascript"
    1.17 +          src="../role.js"></script>
    1.18 +
    1.19 +  <script type="application/javascript">
    1.20 +    function doTest()
    1.21 +    {
    1.22 +      var accTree = {
    1.23 +        role: ROLE_LISTBOX,
    1.24 +        children: [
    1.25 +          {
    1.26 +            role: ROLE_GROUPING,
    1.27 +            children: [
    1.28 +              {
    1.29 +                role: ROLE_STATICTEXT,
    1.30 +                children: [ ]
    1.31 +              },
    1.32 +              {
    1.33 +                role: ROLE_OPTION,
    1.34 +                children: [
    1.35 +                  {
    1.36 +                    role: ROLE_TEXT_LEAF
    1.37 +                  }
    1.38 +                ]
    1.39 +              },
    1.40 +              {
    1.41 +                role: ROLE_OPTION,
    1.42 +                children: [
    1.43 +                  {
    1.44 +                    role: ROLE_TEXT_LEAF
    1.45 +                  }
    1.46 +                ]
    1.47 +              }
    1.48 +            ]
    1.49 +          },
    1.50 +          {
    1.51 +            role: ROLE_OPTION,
    1.52 +            children: [
    1.53 +              {
    1.54 +                role: ROLE_TEXT_LEAF
    1.55 +              }
    1.56 +            ]
    1.57 +          }
    1.58 +        ]
    1.59 +      };
    1.60 +      testAccessibleTree("listbox", accTree);
    1.61 +
    1.62 +      accTree = {
    1.63 +        role: ROLE_COMBOBOX,
    1.64 +        children: [
    1.65 +          {
    1.66 +            role: ROLE_COMBOBOX_LIST,
    1.67 +            children: [
    1.68 +              {
    1.69 +                role: ROLE_GROUPING,
    1.70 +                children: [
    1.71 +                  {
    1.72 +                    role: ROLE_STATICTEXT,
    1.73 +                    children: [ ]
    1.74 +                  },
    1.75 +                  {
    1.76 +                    role: ROLE_COMBOBOX_OPTION,
    1.77 +                    children: [
    1.78 +                      {
    1.79 +                        role: ROLE_TEXT_LEAF
    1.80 +                      }
    1.81 +                    ]
    1.82 +                  },
    1.83 +                  {
    1.84 +                    role: ROLE_COMBOBOX_OPTION,
    1.85 +                    children: [
    1.86 +                      {
    1.87 +                        role: ROLE_TEXT_LEAF
    1.88 +                      }
    1.89 +                    ]
    1.90 +                  },
    1.91 +                ]
    1.92 +},
    1.93 +              {
    1.94 +                role: ROLE_COMBOBOX_OPTION,
    1.95 +                children: [
    1.96 +                  {
    1.97 +                    role: ROLE_TEXT_LEAF
    1.98 +                  }
    1.99 +                ]
   1.100 +              }
   1.101 +            ]
   1.102 +          }
   1.103 +        ]
   1.104 +      };
   1.105 +      testAccessibleTree("combobox", accTree);
   1.106 +
   1.107 +      SimpleTest.finish();
   1.108 +    }
   1.109 +
   1.110 +    SimpleTest.waitForExplicitFinish();
   1.111 +    addA11yLoadEvent(doTest);
   1.112 +  </script>
   1.113 +</head>
   1.114 +<body>
   1.115 +
   1.116 +  <a target="_blank"
   1.117 +     title="remove all the code in #ifdef COMBO_BOX_WITH_THREE_CHILDREN"
   1.118 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=506616">
   1.119 +    Mozilla Bug 506616
   1.120 +  </a>
   1.121 +  <p id="display"></p>
   1.122 +  <div id="content" style="display: none"></div>
   1.123 +  <pre id="test">
   1.124 +  </pre>
   1.125 +
   1.126 +  <select id="listbox" size="4">
   1.127 +    <optgroup label="Colors">
   1.128 +      <option>Red</option>
   1.129 +      <option>Blue</option>
   1.130 +    </optgroup>
   1.131 +    <option>Animal</option>
   1.132 +  </select>
   1.133 +
   1.134 +  <select id="combobox">
   1.135 +    <optgroup label="Colors">
   1.136 +      <option>Red</option>
   1.137 +      <option>Blue</option>
   1.138 +    </optgroup>
   1.139 +    <option>Animal</option>
   1.140 +  </select>
   1.141 +</body>
   1.142 +</html>

mercurial