Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/accessibility/input-mixed.html |
| diff --git a/third_party/WebKit/LayoutTests/accessibility/input-mixed.html b/third_party/WebKit/LayoutTests/accessibility/input-mixed.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c4214648b1d2f88bb0195a77f6b78cc6e1f52b68 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/accessibility/input-mixed.html |
| @@ -0,0 +1,58 @@ |
| +<!DOCTYPE HTML> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<!-- Will set indeterminate state via JS --> |
| +<input id="element1" type="checkbox" /> |
| +<script> |
| + // No way currently to do this via markup, must be via JS |
| + document.getElementById('element1').indeterminate = true; |
| +</script> |
| +<!-- Control--> |
| +<input id="element2" type="checkbox" /> |
| + |
| +<div> |
| + <!-- Will be ::intederminate in CSS because no radio item selected yet --> |
|
dmazzoni
2017/03/09 19:33:41
spelling
aleventhal
2017/03/09 21:40:49
Done.
|
| + <input type="radio" name="radiogroup1" /> |
| + <input id="element3" type="radio" name="radiogroup1" /> |
| +</div> |
| + |
| +<div> |
| + <!-- NOT mixed/intederminate because group has a selected radio button --> |
|
dmazzoni
2017/03/09 19:33:41
same
aleventhal
2017/03/09 21:40:49
Done.
|
| + <input id="element4" type="radio" name="radiogroup2" /> |
| + <input id="element5" type="radio" checked name="radiogroup2" /> |
| +</div> |
| + |
| +<script> |
| + |
| + function axElementById(id) { |
| + return accessibilityController.accessibleElementById(id); |
| + } |
| + |
| + test(function(t) { |
| + var ax = axElementById("element1"); |
| + assert_true(ax.isButtonStateMixed); |
| + }, "A native indeterminate checkbox must have the mixed state"); |
| + |
| + test(function(t) { |
| + var ax = axElementById("element2"); |
| + assert_false(ax.isButtonStateMixed); |
| + }, "A native checkbox that is not indeterminate" + |
| + " must NOT have the mixed state"); |
| + |
| + test(function(t) { |
| + var ax = axElementById("element3"); |
| + assert_true(ax.isButtonStateMixed); |
| + }, "A native radio that in a group with nothing checked" + |
| + " must have the mixed state"); |
| + |
| + test(function(t) { |
| + var ax = axElementById("element4"); |
| + assert_false(ax.isButtonStateMixed); |
| + }, "A native radio that in a group with something checked" + |
| + " must NOT have the mixed state"); |
| + |
| + test(function(t) { |
| + var ax = axElementById("element4"); |
| + assert_false(ax.isButtonStateMixed); |
| + }, "A checked native radio must NOT have the mixed state"); |
| +</script> |