| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
| 4 | 4 |
| 5 <select> | 5 <select> |
| 6 <option id="element1" role="menuitemcheckbox">1</option> | 6 <option id="element1" role="menuitemcheckbox">1</option> |
| 7 <option id="element2" role="menuitemcheckbox" aria-checked="true">2</option> | 7 <option id="element2" role="menuitemcheckbox" aria-checked="true">2</option> |
| 8 <option id="element3" role="menuitemradio">3</option> | 8 <option id="element3" role="menuitemradio">3</option> |
| 9 <option id="element4" role="menuitemradio" aria-checked="true">4</option> | 9 <option id="element4" role="menuitemradio" aria-checked="true">4</option> |
| 10 <!-- Checked not supported --> | 10 <!-- Checked not supported --> |
| 11 <option id="element5" aria-checked="true">5</option> | 11 <option id="element5" aria-checked="true">5</option> |
| 12 </select> | 12 </select> |
| 13 | 13 |
| 14 <script> | 14 <script> |
| 15 | 15 |
| 16 function axElementById(id) { | 16 function axElementById(id) { |
| 17 return accessibilityController.accessibleElementById(id); | 17 return accessibilityController.accessibleElementById(id); |
| 18 } | 18 } |
| 19 | 19 |
| 20 test(function(t) { | 20 test(function(t) { |
| 21 var ax = axElementById("element1"); | 21 var ax = axElementById("element1"); |
| 22 assert_false(ax.isChecked); | 22 assert_equals(ax.checkedState, "false"); |
| 23 }, "<option> of role menuitemcheckbox is not checked by default"); | 23 }, "<option> of role menuitemcheckbox is not checked by default"); |
| 24 | 24 |
| 25 test(function(t) { | 25 test(function(t) { |
| 26 var ax = axElementById("element2"); | 26 var ax = axElementById("element2"); |
| 27 assert_true(ax.isChecked); | 27 assert_equals(ax.checkedState, "true"); |
| 28 }, "<option> of role menuitemcheckbox can be checked with aria-checked"); | 28 }, "<option> of role menuitemcheckbox can be checked with aria-checked"); |
| 29 | 29 |
| 30 test(function(t) { | 30 test(function(t) { |
| 31 var ax = axElementById("element3"); | 31 var ax = axElementById("element3"); |
| 32 assert_false(ax.isChecked); | 32 assert_equals(ax.checkedState, "false"); |
| 33 }, "<option> of role menuitemradio is not checked by default"); | 33 }, "<option> of role menuitemradio is not checked by default"); |
| 34 | 34 |
| 35 test(function(t) { | 35 test(function(t) { |
| 36 var ax = axElementById("element4"); | 36 var ax = axElementById("element4"); |
| 37 assert_true(ax.isChecked); | 37 assert_equals(ax.checkedState, "true"); |
| 38 }, "<option> of role menuitemradio can be checked with aria-checked"); | 38 }, "<option> of role menuitemradio can be checked with aria-checked"); |
| 39 | 39 |
| 40 test(function(t) { | 40 test(function(t) { |
| 41 var ax = axElementById("element5"); | 41 var ax = axElementById("element5"); |
| 42 assert_false(ax.isChecked); | 42 assert_equals(ax.checkedState, "false"); |
| 43 }, "<option> of no role is not checked even with aria-checked set"); | 43 }, "<option> of no role is not checked even with aria-checked set"); |
| 44 | 44 |
| 45 </script> | 45 </script> |
| OLD | NEW |